How vinith2431/null_bytes_track-2 works
Aegis is a defense-in-depth security system for tool-using LLM agents. Its main workflow takes a user message through input guards and model reasoning, gates proposed tool actions, scans retrieved content, then verifies a grounded answer before returning it and recording security events. The graph preserves documented Q-Gate, classical detection, taint/action authorization, and output-verification branches. Some subsystem links rely on README-level workflow descriptions; unsampled implementation details are not inferred beyond those documented relationships.
Main entry points: pipeline.py Agent pipeline · llm.py LLM interface · action_token.py Action tokens · server.py Web chat
Components 25
User Entry
- Web chat
web/server.py
Agent Control
- Agent pipeline
aegis/pipeline.py - Session contracts
aegis/contracts.py - Layer config
aegis/config.py
Security Layers
- Input guards
aegis/inputguard/classify.py - Input normalization
aegis/inputguard/normalize.py - Turn risk
aegis/inputguard/risk.py - Tool safety gate
aegis/toolsafety/gate.py - Action tokens
aegis/line1/action_token.py - Taint tracking
aegis/line1/taint.py - Retrieved-content checks
aegis/ingress/process.py - Sensitive-data scan
aegis/ingress/scan.py - Q-Gate detector
aegis/qgate/detector.py - Quantum kernel
aegis/qgate/kernel.py - Classical RBF
aegis/qgate/baseline_rbf.py
Tools and Answers
- Simulated tools
aegis/tools/sim.py - Grounded prompting
aegis/grounding/prompt.py - Citation checks
aegis/output/citation_check.py - Claim entailment
aegis/output/nli.py - Output decisions
aegis/output/decide.py - Output refusal
aegis/output/refusal.py
Model and Audit
- LLM interface
aegis/llm.py - LLM provider
- Hash-chain audit
aegis/audit/chain.py
Other components
- User
Connections 26
- User → Web chat: sends message
README.md - Web chat → Agent pipeline: runs turn
web/server.py - Agent pipeline → Input normalization: normalizes input
README.md - Agent pipeline → Input guards: classifies input
README.md - Agent pipeline → Turn risk: tracks risk
README.md - Agent pipeline → LLM interface: requests reasoning
README.md - LLM interface → LLM provider: calls model
aegis/llm.py - Agent pipeline → Tool safety gate: checks tool call
aegis/pipeline.py - Tool safety gate → Action tokens: mints token
aegis/toolsafety/gate.py - Agent pipeline → Action tokens: authorizes action
aegis/pipeline.py - Agent pipeline → Taint tracking: marks arguments
aegis/pipeline.py - Agent pipeline → Simulated tools: executes permitted call
README.md - Simulated tools → Action tokens: consumes token
aegis/tools/sim.py - Agent pipeline → Retrieved-content checks: processes retrieved content
README.md - Retrieved-content checks → Sensitive-data scan: scans content
aegis/ingress/process.py - Agent pipeline → Q-Gate detector: checks untrusted text
README.md - Q-Gate detector → Quantum kernel: scores kernel
aegis/qgate/detector.py - Agent pipeline → Classical RBF: checks classical baseline
README.md - Agent pipeline → Grounded prompting: builds grounded prompt
README.md - Grounded prompting → LLM interface: generates answer
README.md - Agent pipeline → Citation checks: validates citations
README.md - Agent pipeline → Claim entailment: checks entailment
README.md - Agent pipeline → Output decisions: decides answer
README.md - Output decisions → Output refusal: returns refusal
aegis/output/decide.py - Agent pipeline → Hash-chain audit: records events
aegis/pipeline.py - Agent pipeline → Layer config: reads layer flags
aegis/pipeline.py