The simplest target shape is an agent exposed over an HTTP endpoint that accepts a JSON body with a prompt and returns a JSON response. If your agent has aDocumentation Index
Fetch the complete documentation index at: https://docs.agentguardian.io/llms.txt
Use this file to discover all available pages before exploring further.
/chat, /invoke, or /v1/messages-style endpoint, this is
the page for you.
What this example tests
- Black-box red-team of a hosted HTTP agent — no source access required.
- All 10 ASI categories (prompt injection, tool abuse, goal hijack, detection evasion, supply-chain, etc.) against the endpoint as the swarm sees it.
- The
--endpointmode runs a pre-flight reachability check first so an unreachable target fails fast withEXIT_TARGET_UNREACHABLE(code 6) instead of burning LLM budget.
src/agent_guardian/transports/http.py.
Prerequisites
- AgentGuardian installed —
pip install agent-guardian(oruv syncin a checkout of the repo). - An HTTP endpoint that accepts
POSTwith a JSON body and returns a JSON response. The default request template is{"input": "<prompt>"}and the default response shape is generic JSON; if your endpoint requires a different shape, use a contract (see Scan an MCP server for the contract pattern). - A model spec.
--model stubruns offline with no keys and is the fastest way to get a clean run. For a real assessment, set one of:OPENAI_API_KEYfor--model openai:gpt-4oGEMINI_API_KEYfor--model gemini:gemini-2.5-flashANTHROPIC_API_KEYfor--model anthropic:claude-haiku-4-5
Run target
You have two easy options: Option A — Use the public testbench. AgentGuardian operates a deliberately-vulnerable hosted agent (finbot, a banking assistant) at
a public Cloud Run URL. No setup required:
my_agent.py, then run uvicorn my_agent:app --port 8000:
my_agent.py
Run AgentGuardian
Against the public testbench:src/agent_guardian/cli.py:
--endpoint URL— hosted HTTP endpoint of the target agent. Mutually exclusive with the positionaltarget,--system-prompt,--framework, and--contractmodes.--model stub— universal safe default. Runs the scan offline with no LLM keys. Swap forgemini:gemini-2.5-flash,openai:gpt-4o,anthropic:claude-haiku-4-5,ollama:llama3.1, or a Bedrock model spec for a real assessment.--mode fast— caps each agent at 3 probes / 4 turns (~45s, ~$0.008 on Gemini). Use--mode smartfor the v1.0 default (early-stop) or--mode fullfor the authoritative run (default).--output md --output-path scan.md— Markdown report atscan.md. Other formats:json,sarif,junit,pdf.
Expected output
The Markdown report opens with the scan header. The exact AIVSS number depends on--model, --mode, and the target:
--model stub scan always comes back clean — the stub model gives the
swarm nothing to attack with. Re-run with --model gemini:gemini-2.5-flash
against the live finbot testbench and you should land in the POOR
band (40–59) with several findings under asi01.* and asi02.*.
Common errors
EXIT_TARGET_UNREACHABLE(exit code 6). The pre-flight reachability checkPOSTs an empty body twice with a 2-second timeout. If both attempts fail withConnectError/Timeout, the scan exits before burning budget. Pass--no-preflightto skip the check if your endpoint refuses empty bodies but is actually up.422 Unprocessable Entityon every request. Your endpoint expects a different request shape than{"input": "<prompt>"}. Use a target contract to declare a custom request template andoutput_pathfor response extraction.401 Unauthorized/403 Forbidden. Your endpoint requires auth. The--endpointmode is unauthenticated; use a contract with theauth:block for bearer, API-key, OAuth2, mTLS, AWS SigV4, GCP ADC, or Azure Entra authentication.- Scan finishes with
coverage = Candband = not_evaluated. Expected with--model stub. Re-run with a real model spec to get a graded AIVSS score.
Next step
- For a tool-bearing or memory-bearing target, read Scan a LangGraph agent for the in-process framework-adapter pattern that gives the swarm better visibility.
- For an authenticated or shape-customised target, see the Config file reference for the contract schema (transports, auth, RoE).
- To gate a CI build on AIVSS, wire this scan into
GitHub Actions with
--fail-under 70.