Help

Troubleshooting

The errors people hit most often in a first integration, what each one means, and how to fix it.

PermissionError: arg 'path' value '…' not in capability spec

You expected this call to be allowed. It's almost always a path representation mismatch, not a policy error. Compare the string in the denial with the paths in the spec. Usually both name the same file, just differently (/sandbox/notes.txt vs C:\…\sandbox\notes.txt). The record's matched_rule is rule-7-value-not-allowed.

Fix: put absolute paths in the request, and pass the same string to propose_spec and agent.run. Full explanation.

PermissionError: tool '…' not in capability spec for server '…'

rule-2-tool-not-listed: the agent called a tool the proposer didn't include. This is common with multi-file requests, where the agent batches into read_multiple_files but the spec only allows read_text_file.

Fix: add the tool. Constrain its list argument with must_match_one_of, which is matched one element at a time. A list argument with no constraint is denied with rule-7-unconstrained-collection rather than quietly allowing every path.

PermissionError: policy evaluation failed

The policy evaluator itself threw an unexpected error, so Aegis failed closed. This is deliberate: when the security layer breaks, the safe response is to deny. Look in logs/audit.jsonl for the policy_evaluation_error record, which contains the underlying exception. Please open an issue with it.

SpecValidationError from load_spec() or propose_spec()

The spec failed schema validation, and the message names the field. Common causes:

  • Missing required fields: task or servers.
  • deny_all_others: false without the string deny_all_others=false in task. This is intentional, so that a weaker posture has to be acknowledged.
  • must_match_one_of: [], or allow_any together with must_match_one_of.

ImportError or ModuleNotFoundError on from aegis import …

pip install worked, but you're running a different Python environment than the one you installed into.

shell
python -c "import sys; print(sys.executable)"
# activate the right venv:  source .venv/bin/activate   (Windows: .venv\Scripts\Activate.ps1)
pip install --force-reinstall git+https://github.com/obengbuo/aegis.git@v0.2.1

Could not resolve authentication method from propose_spec()

propose_spec() calls the Anthropic API and needs ANTHROPIC_API_KEY. Aegis calls load_dotenv() on import, so a .env file in your working directory also works.

shell
python -c "import os; print(bool(os.getenv('ANTHROPIC_API_KEY')))"

If you don't want to use the proposer, load a hand-written YAML spec with load_spec() instead. It needs no API key.

FileNotFoundError [WinError 2] or command not found: npx

The runnable example starts the filesystem MCP server with npx, which needs Node.js. Install any recent LTS from nodejs.org, then run npx --version in a fresh terminal to check it.

ModelHTTPError: 529 Overloaded

The model API was overloaded. This is temporary and comes from outside Aegis, which wraps tool calls, not model calls. Retry after 30–60 seconds. In CI, mark integration tests as flaky with reruns.

Records aren't reaching the control plane

  • Check control_plane_url is set. If it isn't, nothing is shipped.
  • Look for a 4xx line on stderr. It names the status code and what to check (usually the API key or deployment_id).
  • If the run's opening record is missing, the config was probably created after the spec was loaded. See order matters.

Still stuck?

Open an issue at github.com/obengbuo/aegis/issues with the relevant lines from logs/audit.jsonl, or get in touch directly.

Source of truth: INTEGRATION.md on GitHub. If this page and the repository disagree, the repository wins — and please open an issue.