add-backend

add-backend is a skill for Claude Code, Codex from alibaba/anolisa. It costs 46 tokens per session (3,954 once invoked), scanned A, original, Apache-2.0.

A guide for adding a Rust or Python backend to agent-sec-core, a security middleware system that connects actions to different implementations.

In plain words
What is it for?
Choosing Rust or Python, naming the backend's files and identifiers, implementing its execution interface, and exposing it through the CLI.
Why use it?
It explains how to connect a new backend consistently to the router and command-line interface, without changing how the middleware calls it.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/alibaba/anolisa/backend-skill
Any agent
npx skills add alibaba/anolisa --skill backend-skill
Clone the repo
git clone --depth 1 https://github.com/alibaba/anolisa

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for add-backend

README.md
[![agentmods](https://agentmods.dev/badge/skills/alibaba/anolisa/backend-skill.svg)](https://agentmods.dev/skills/alibaba/anolisa/backend-skill)
Your own site
<a href="https://agentmods.dev/skills/alibaba/anolisa/backend-skill"><img src="https://agentmods.dev/badge/skills/alibaba/anolisa/backend-skill.svg" alt="Measured on agentmods" height="20"></a>
Per session 46 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,954 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00046 $0.03954
Opus 5 $0.00023 $0.01977
Sonnet 5 $0.00009 $0.00791
Haiku 4.5 $0.00005 $0.00395

Measured 4d ago against content hash 4c147c3cb426, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

add-backend scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

The scan reads SKILL.md. This mod also ships 2 executable files (templates/python_backend.py, templates/rust_backend.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

src/agent-sec-core/agent-sec-cli/dev-tools/backend-skill/SKILL.md · 542 lines

How it starts

The opening of the file, as written. The whole thing — 542 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Adding a Backend to Security Middleware

This skill walks through the complete, end-to-end process of adding a backend (Rust or Python) to the security middleware, wiring it into the router, and exposing it through the CLI.

Unified interface: Both Rust and Python backends implement the same execute(ctx, **kwargs) → ActionResult contract. The middleware doesn't care about the implementation language.

Backend Type Selection

Type Use Case Pros Cons
rust Performance-critical, CPU-intensive tasks High performance, memory safety Requires Rust toolchain, compilation
python Rapid development, glue code, existing libraries Fast iteration, rich ecosystem Slower execution, GIL limitations

Naming Convention

Derive all identifiers from the backend_name argument:

Concept Rule Example (backend_name = "code verify")
action_name lowercase, underscores code_verify
Backend class PascalCase + Backend CodeVerifyBackend
Python module {action_name}.py code_verify.py
lifecycle category same as action_name code_verify

Rust-specific (only when backend_type=rust):

Concept Rule Example
Rust function same as action_name code_verify
Request struct PascalCase + Request CodeVerifyRequest
Response struct PascalCase + Response CodeVerifyResponse

1. Architecture Overview

Both backend types follow the same execution flow:

agent-sec-cli  ──→  security_middleware.invoke("{action_name}", **kwargs)
                            │
                            ├─ router.get_backend("{action_name}")
                            │      └─ _REGISTRY["{action_name}"] → "security_middleware.backends.{action_name}"
                            │      └─ lazy import → {ActionName}Backend()
                            │
                            ├─ backend.execute(ctx, **kwargs) → ActionResult
                            │      │
                            │      ├─ [Rust]  from agent_sec_cli._native import {action_name}
                            │      │          {action_name}(json_in) → json_out
                            │      │
                            │      └─ [Python] import {module_path}
                            │                  module.function(**kwargs) → result
                            │
                            └─ lifecycle.post_action() → SecurityEvent → JSONL

Read the full file on GitHub · 542 lines

Files

What ships with it

4 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 542 lines · 46 tokens per session scan A 4c147c3cb426

Subscribe to this mod's changes

add-backend is a skill published in the GitHub repository alibaba/anolisa (618 stars, last pushed today), licensed Apache-2.0. It adds 46 tokens to every session and 3,954 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

beevibe-team-mesh-negotiation

Multi-round negotiation protocol — covers both initiator and peer roles. Use when about to call negotiate(), when receiving a intent block as a peer, or when receiving an 'escalated' sentinel from a blocked respondnegotiate. Covers proposal crafting, counter-strategy, deadlock detection, when to accept early…

beevibe-ai/beevibe · 112 tokens

beevibe-verify-pr

CI verification before marking a PR-bearing task done. Use BEFORE calling mcpbeevibeupdateprogress(done) on any session whose deliverable is a pull request — including the first dispatch (you opened the PR with gh pr create) and any revision dispatch (you pushed new commits to an existing PR). Watches the PR's…

beevibe-ai/beevibe · 172 tokens

beevibe-pre-task-setup

Cold-start git workspace setup for a fresh beevibe task. Use at the start of a session whose intent has a block but NO or block — i.e. the first dispatch of this task. Checks for an existing repo clone, pulls the base branch if present (clone if missing), prunes any per-task worktrees from earlier tasks whose work has…

beevibe-ai/beevibe · 198 tokens

beevibe-use-repo

You are the child agent inside a fresh Docker sandbox. Borrow the given GitHub repo, produce a real artifact for the goal, and export it. Do not review the repo. The proof is that it works.

beevibe-ai/beevibe · 50 tokens

spec-converge

Iteratively review an instar-development spec with multi-angle internal reviewers (security, scalability, adversarial, integration, decision-completeness, lessons-aware) and real cross-model external reviewers routed through the agent's own installed CLIs (codex → GPT-tier, gemini → Gemini-tier; one pass per available…

JKHeadley/instar · 135 tokens

beevibe-discover-repo

Find the best GitHub repo for a goal, then call userepo to run it in a sandbox. Use whenever the user's goal requires a capability you don't have natively and you haven't been given a specific repo.

beevibe-ai/beevibe · 51 tokens