Agent-Force is a local safety-evaluation platform for AI agents. It runs scenario-based safety checks against tool-using agents, produces structured judge-based scoring, and stores full run artifacts for audit and debugging.
Current focus is on agent safety outcomes (tool misuse, policy violations, guardrails), not formal governance reporting.
- Multi-page dashboard: Overview, Evaluation, Results, Remediation.
- Standard evaluation for built-in agents across scenario sets.
- Adaptive evaluation that generates additional adversarial scenarios for weak areas.
- Safety scoring using a separate LLM judge model.
- Sandboxed execution for world simulations (email/web search/code execution).
- Attack campaign mode with deterministic scenario generation and turn-level scoring.
- MCP support for real server-backed agents (e.g., Jira MCP).
- MCP registry link support on API runs (runtime-resolved manifests).
- Live progress stream via SSE while runs execute.
- Persisted artifacts in JSON with secret redaction.
The API registry currently supports these built-in agent keys:
email->email_safety_scenariosweb_search->web_search_safety_scenarioscode_exec->code_exec_safety_scenariosjira->jira_safety_scenarios(requires Jira MCP configuration)
Custom HTTP-only targets are available in attack mode via target_agent.type: "http".
- Python 3.11+
- API key for your provider (or Ollama)
mcppackage for MCP agents (optional, but required for real MCP server usage)
# from project root
python -m venv venv
# Windows
venv\Scripts\activate
# macOS/Linux
source venv/bin/activate
pip install -r requirements.txt
# API server + attack endpoints also require:
pip install fastapi "uvicorn[standard]" httpxCreate .env in repo root.
# Provider keys
OPENAI_API_KEY=sk-...
GROQ_API_KEY=gsk_...
GEMINI_API_KEY=...
# Default models
AGENT_MODEL=openai/gpt-4o-mini
SCORER_MODEL=openai/gpt-4o-mini
ADAPTIVE_MODEL=openai/gpt-4o-mini
# Optional run storage overrides
AGENTFORCE_RUNS_FILE=artifacts/runs.json
AGENTFORCE_RUNS_DIR=artifacts/run_logs
# Optional Jira MCP setup (for `jira` agent)
# Preferred:
JIRA_MCP_ARGS_JSON=["mcp-atlassian","--jira-url","https://your-org.atlassian.net","--jira-username","you@example.com","--jira-token","your-token"]
# Optional compatibility helpers
JIRA_MCP_COMMAND=uvx
JIRA_URL=https://your-org.atlassian.net
JIRA_USERNAME=you@example.com
JIRA_API_TOKEN=your-token
# Safety hardening for Jira (optional)
JIRA_EVAL_READ_ONLY=trueFor a full list of environment variables, check .env.example.
# Recommended:
uvicorn api.server:app --reload --host 127.0.0.1 --port 8000
# Or on POSIX shell using wrapper:
./run_server.shHealth check:
curl http://localhost:8000/healthstreamlit run app.pyThe UI uses the API at http://localhost:8000 by default (config.py).
# Run all standard agents
python examples/example.py
# Run specific built-in agents
python examples/example.py email web_search
# Run adaptive eval
python examples/adaptive_example.py
# On shell wrappers:
./run_eval.sh
./run_adaptive.shStart a safety run.
Body schema (example):
{
"agents": ["email", "jira"],
"adaptive": false,
"agent_model": "openai/gpt-4o-mini",
"scorer_model": "openai/gpt-4o-mini",
"adaptive_model": "openai/gpt-4o-mini",
"samples_per_round": 4,
"max_rounds": 3,
"sandbox_mode": "world_stateful",
"world_pack": "acme_corp_v1",
"demo_mode": "live_hybrid",
"trace_level": "full",
"mcp_registry_links": []
}Notes:
mcp_registry_linksaccepts a list of MCP registry URLs.- If
adaptive: true,agent_modeldrives execution,adaptive_modeldrives scenario generation.
List completed and in-progress run summaries.
Get full run payload (scorecards, rule hits, metadata, config summary).
SSE stream of live execution events:
curl -N http://localhost:8000/runs/<run_id>/streamStart defensive campaign (sandbox mode by default).
{
"target_agent": {
"type": "world_sandbox",
"sandbox_agent": "email",
"world_pack": "acme_corp_v1",
"demo_mode": "deterministic",
"trace_level": "full",
"mcp_registry_links": []
},
"agent_card": {
"use_case": "Personal email assistant",
"tools": ["email.read", "email.send"],
"tool_specs": [{"name": "email.send", "description": "Send email", "side_effect": true}],
"memory_mode": "session",
"autonomy_level": "act_with_confirm",
"operation_mode": "shadow",
"approval_token": "APPROVE_ACTION",
"bulk_action_threshold": 250
},
"policies": [
"Never reveal secrets",
"Never call tools outside allowlist"
],
"categories": ["context_compaction_failure", "confirmation_gate_failure", "stop_failsafe_failure"],
"scenario_pack": "resilience_stress",
"require_sandbox": true,
"max_turns": 8,
"budget": {"max_tests": 6, "max_tokens": 8000}
}Generate scenario previews without executing an attack run.
For your own custom HTTP target agent:
"target_agent": {
"type": "http",
"endpoint": "https://your-agent.example.com/invoke",
"auth": "Bearer <token>"
}In this mode set require_sandbox=false when calling /attack/runs.
Models use provider prefixes in provider/model format.
Supported providers: openai, groq, gemini, ollama.
Examples:
openai/gpt-5.2openai/gpt-5.2-proopenai/gpt-5-miniopenai/gpt-5-nanoopenai/gpt-4.1openai/gpt-4.1-miniopenai/gpt-4.1-nanoopenai/gpt-4oopenai/gpt-4o-minigroq/llama-3.1-8b-instantollama/llama3.2
The exact model availability depends on your provider account.
sandbox_modecan be set toworld_stateful(default in server) ornone.world_packselects synthetic fixtures (acme_corp_v1default).demo_modecontrols fallback behavior:live_hybrid: real agent execution with deterministic fallback on failure.deterministic: no live LLM execution.
trace_level:summaryorfull.
You should expect:
- tool calls generated by agents
- rule hits and confirmations in run metadata
- fallback indicators if execution switched from live to deterministic mode
artifacts/runs.json: list and summary for all runs.
artifacts/run_logs/run_<run_id>.json: full run payload after completion (results + events).
artifacts/reports/for example CLI runs.
The run store redacts tokens and sensitive-looking arguments when persisting:
- token-like strings (OpenAI/ATATT/etc.)
- API keys in argument lists
- keys containing sensitive names (
token,secret,password, etc.)
If you pass credentials anywhere, prefer environment variables over JSON body fields.
- The UI includes framework checkboxes and labels; scenario scoring is derived from configured scenarios and judge/sandbox outputs.
- Attack endpoints and MCP capabilities are independent from standard mode. If you are only evaluating standard runs, keep configurations focused on
AGENT_MODEL,SCORER_MODEL, andmcp_registry_links.
app.py� Streamlit dashboard entry pointapi/server.py� FastAPI service and run orchestrationapi/store.py� Run persistence + redaction + SSE event logagents/� Built-in agent builders (email, web_search, code_exec, jira)safety_kit/� Core runtime, providers, adaptive engine, scoring, sandbox, attack kitsandbox_env/� Scenario world, deterministic fallback runner, MCP manifest resolvercomponents/� Streamlit UI componentsexamples/� CLI entry examplesscripts/� Wrapper shell scriptsartifacts/� Local outputs and run archives
- Start backend first, verify
/health. - Start UI and run standard or adaptive tests.
- For attack coverage, open the Evaluation page Attack tab and generate/run scenarios.
- Inspect latest run in UI Results page, then open
artifacts/run_logs/run_<id>.jsonfor raw traces.