http://localhost:11434. The
target AgentGuardian scans is still an HTTP agent — the agent’s model
backend happens to be Ollama. Point --endpoint at the agent.
What this example tests
- All 10 ASI categories against an HTTP-exposed agent backed by an on-device model.
- The
ollama:model spec for the swarm itself (--model ollama:llama3.1) — graded scans with no external API costs.
Prerequisites
- AgentGuardian installed —
pip install agent-guardian. - Ollama installed and running locally:
ollama serve. - A model pulled into Ollama:
ollama pull llama3.1. - The bundled
examples/ollama_local/fixture, or your own agent that calls Ollama.
Run target
Host install:OLLAMA_BASE_URL and AG_DEMO_OLLAMA_MODEL from
the environment so both invocation patterns work without code edits.
Run AgentGuardian
src/agent_guardian/cli.py:
--endpoint URL— hosted HTTP endpoint of the agent.--model stub/--model ollama:<name>— stub is offline; the Ollama spec drives the swarm with the same local instance the agent uses.--mode fast—fast/smart/full(default).--output md --output-path scan.md— Markdown report.
Expected output
examples/ollama_local/sample-scan.json ships a committed reference
scan for --model stub. The notes field documents what changes when
you swap in ollama:llama3.1.
Common errors
ollama-demo: cannot reach Ollama at http://localhost:11434. The bundled agent returns this string when Ollama is not running. Start it withollama serveand re-pull the model.- Scan stalls with
--model ollama:<name>. The swarm is blocked waiting for Ollama to load the model into memory. Run a single warm-up prompt against Ollama first (curl -s http://localhost:11434/api/chat -d '{"model":"llama3.1","stream":false,"messages":[{"role":"user","content":"hi"}]}'). Pull completebut scan still uses a different model. Ollama serves the model named in the request — confirmAG_DEMO_OLLAMA_MODELmatches the model you pulled.
Next step
- For a full local-CI loop with no external dependencies, combine the Ollama stack with GitHub Actions using a self-hosted runner.
- For a tool-bearing target, read Scan a LangGraph agent.