The Problem It Solves
AI-assisted coding accelerates software delivery, but unconstrained coding agents can leak credentials or PII to external model providers, commit unreviewed or vulnerable code directly to main branches, or fall victim to prompt injection hidden inside repositories.
How It Works
Aegis Harness wraps the developer workflow between the engineer, coding LLMs, and Git. Every prompt passes through a secret and PII redactor and a three-tier policy engine before reaching approved model providers. Code changes are isolated to task branches, scanned by security and licence gates before commit, recorded in a SHA-256 hash-chained audit log, and streamed as OpenTelemetry spans to Aegis mapped to FRAME and AAEF.
Key Features
Provider-Agnostic Model Gateway
Supports Anthropic, OpenAI, Google Gemini, Agnes AI (agnes-coder), and local OpenAI-compatible endpoints (Ollama, vLLM), routing by task type, data classification, and USD cost ceilings.
Secret & PII Redaction
Scrubs API keys, tokens, private keys, emails, phone numbers, and NRIC/FIN numbers before outbound model calls, logging only the redacted category.
Policy-as-Code & Three Risk Tiers
Evaluates low, medium, and high risk tiers with per-tier approval counts, diff-size caps, restricted path rules, and separation of duties (approver != requester).
Git Isolation & Check-in Gates
Blocks direct commits to main, enforces agent/<task-id> branches with SSH/GPG signatures and AI provenance trailers, and runs secret, SAST, prompt-injection, and dependency/licence scans.
Sandbox & 5-Second Kill Switch
Executes agent commands in isolated Git worktrees or network-disabled Docker containers with short-lived HMAC-signed task tokens that are revoked immediately on kill switch activation.
Local Web Dashboard & Coding Studio
Includes a token-protected PWA dashboard (/studio, /config, /manual) for governed prompting, inline human approvals, form-based YAML policy editing, and live telemetry inspection.
Architecture Overview
- Python CLI and FastAPI web dashboard (/studio, /config, /manual) packaged with Docker Compose.
- Pydantic v2 validated configuration (.harness/config.yaml) and editable FRAME/AAEF event mapping (config/frame_aaef_mapping.yaml).
- Append-only JSONL audit chain with SHA-256 entry chaining, HMAC-SHA256 daily checkpoints, and local SQLite state with offline idempotent telemetry queue.
- Includes a STRIDE Threat Model (docs/THREAT_MODEL.md), Operator Runbook (docs/RUNBOOK.md), and pytest suite.
Framework & Standards Alignment
FRAME & AAEF Mapping
Maps every Harness event type to FRAME criteria and AAEF dimensions via config/frame_aaef_mapping.yaml.
OpenTelemetry (OTLP)
Emits HarnessEvent records as OTLP spans and Aegis ingestion payloads.
STRIDE Threat Model
Documents mitigations for spoofing, tampering, repudiation, information disclosure, denial of service, and elevation of privilege.
SPDX & Dependency Gates
Checks dependency vulnerabilities and SPDX licence allow-lists via osv-scanner before check-in.
Who Should Use It
- Engineering and Platform Teams adopting AI coding assistants under enterprise security controls.
- CISOs and Application Security Teams requiring secret redaction, SAST gates, and AI provenance in Git history.
- Regulated Organisations needing separation of duties and tamper-evident audit trails for AI-generated code.
Getting Started
git clone https://github.com/ianloe/aegis-harness.git
cd aegis-harness && python3 -m venv .venv
.venv/bin/pip install -e ".[dev]"
harness init --name my-project --asset-code AI-004
harness task start "Add feature" --risk medium && harness check && harness audit verify
Licence
Apache-2.0. Full source code, configuration templates, and documentation are available in the GitHub repository.
Need Help Applying Aegis Harness?
Tactics Solutions provides AI governance advisory, board briefings, and keynote sessions grounded in these open reference implementations.