/chat endpoint accepting {"input": "..."} and returning
{"output": "..."}. No agent framework, no in-process adapter — just the
HTTP transport.
What this example tests
- All 10 ASI categories at the HTTP boundary.
- The
--endpointmode’s pre-flight reachability check (an unreachable target fails fast withEXIT_TARGET_UNREACHABLEbefore any LLM budget is spent). - The default
{"input": "<prompt>"}request template (no contract required).
src/agent_guardian/transports/http.py.
Prerequisites
- AgentGuardian installed —
pip install agent-guardian. - A FastAPI agent reachable at an HTTP URL. Use the bundled
examples/fastapi_chatbot/fixture or your own. - A model spec —
--model stubfor an offline dry-run, or a real model spec for a graded assessment.
Run target
The bundled fixture is a hermetic stub — no LLM calls, deterministic responses:my_agent.py
uvicorn my_agent:app --port 8000.
Run AgentGuardian
src/agent_guardian/cli.py:
--endpoint URL— hosted HTTP endpoint of the FastAPI agent.--model stub— offline default. Swap for a real model spec (openai:gpt-4o,gemini:gemini-2.5-flash,ollama:llama3.1) for a graded run.--mode fast—fast/smart/full(default).--output md --output-path scan.md— Markdown report. Other formats:json,sarif,junit,pdf.
Expected output
examples/fastapi_chatbot/sample-scan.json ships a committed reference
scan for --model stub. A real-model run typically produces a populated
severity_counts block and a non-null aivss_score.
Common errors
EXIT_TARGET_UNREACHABLE(exit code 6). Two empty-bodyPOSTs with a 2 s timeout both failed. Pass--no-preflightif your endpoint refuses empty bodies but is actually up.422 Unprocessable Entityon every request. Your endpoint expects a different request shape than{"input": "..."}. Declare a target contract with the custom shape — see Config file reference.
Next step
- For a tool-bearing target with framework-adapter visibility, read Scan a LangGraph agent.
- For a retrieval-augmented target, read Scan a RAG application.