How mustafaahmed007/agent-authority works
Agent Authority is a runtime control layer that gates agent tool use with task-scoped authority, policy, risk, and optional approval. Its main path runs from an agent request through the MCP gateway and authority kernel to an authorization decision and, when allowed, execution; the kernel records audit evidence for persistence and later analysis. The README documents verification, replay, graph analysis, anomaly detection, advisory learning, sandboxing, and framework integrations as additional capabilities. Links for unsampled subsystems follow that documentation; source-level evidence is strongest for the kernel, persistence contract, and MCP path.
Main entry points: authority.py Authority kernel · ledger.py Audit ledger · mcp.py MCP gateway · sandbox.py Sandbox execution
Components 25
Authorization
- Agent identity
src/agent_authority/models.py - Task delegation
src/agent_authority/delegation.py - Capability models
src/agent_authority/models.py - Authority kernel
src/agent_authority/authority.py - Policy engine
src/agent_authority/policy.py - Risk engine
src/agent_authority/risk.py - Tool trust
src/agent_authority/trust.py - Human approval
src/agent_authority/authority.py
Execution integrations
- MCP gateway
src/agent_authority/mcp.py - MCP stdio proxy
src/agent_authority/mcp_stdio.py - Sandbox execution
src/agent_authority/sandbox.py - Docker sandbox
src/agent_authority/docker_sandbox.py - Framework adapters
src/agent_authority/frameworks.py
Evidence and analysis
- Outcome verification
src/agent_authority/verification.py - Audit ledger
src/agent_authority/ledger.py - Audit replay
src/agent_authority/replay.py - Authority graph
src/agent_authority/authority_graph.py - Anomaly detection
src/agent_authority/anomaly.py - Advisory learning
src/agent_authority/learning.py
State and cryptography
- Storage contract
src/agent_authority/storage.py - SQLite store
src/agent_authority/sqlite_store.py - Signing and hashes
src/agent_authority/crypto.py
Operations
- Control plane
src/agent_authority/control_plane.py - CLI
src/agent_authority/cli.py
Other components
- Agent
Connections 22
- Agent → MCP gateway: requests tool
README.md - MCP gateway → Authority kernel: authorizes
src/agent_authority/mcp.py - MCP stdio proxy → MCP gateway: filters calls
src/agent_authority/mcp_stdio.py - Framework adapters → MCP gateway: adapts calls
src/agent_authority/frameworks.py - Authority kernel → Policy engine: evaluates policy
src/agent_authority/authority.py - Authority kernel → Risk engine: assesses risk
src/agent_authority/authority.py - Authority kernel → Signing and hashes: uses signing
src/agent_authority/authority.py - Authority kernel → Storage contract: loads and saves
src/agent_authority/authority.py - Authority kernel → Audit ledger: appends events
src/agent_authority/authority.py - Audit ledger → Signing and hashes: hashes events
src/agent_authority/ledger.py - MCP gateway → Authority kernel: records execution
src/agent_authority/mcp.py - Authority kernel → Human approval: requests approval
src/agent_authority/authority.py - Storage contract → SQLite store: durable implementation
README.md - Authority kernel → Outcome verification: checks claims
README.md - Audit ledger → Audit replay: supports replay
README.md - Audit ledger → Authority graph: informs analysis
README.md - Audit ledger → Anomaly detection: informs detection
README.md - Anomaly detection → Advisory learning: feeds signals
README.md - Agent → Sandbox execution: runs restricted
README.md - Sandbox execution → Docker sandbox: can use isolation
README.md - Control plane → Authority kernel: authorizes and revokes
src/agent_authority/control_plane.py - CLI → Authority kernel: operates
src/agent_authority/cli.py