AOS Constitutional Gate โ Threat Model v1.0
Version: 1.0
Date: February 6, 2026
Audit: ChatGPT (OpenAI), February 5, 2026
Status: 36 Vulnerabilities Found, 36 Fixed, Production-Approved
Executive Summary
This document catalogs the complete threat landscape discovered during the ChatGPT security audit of the AOS Constitutional Gate, conducted February 5, 2026.
- Duration: ~3 hours
- Audit passes: 5
- Vulnerabilities identified: 36
- Vulnerabilities fixed: 36
- Final status: Production-ready
Key finding: Through rigorous, iterative security review, we evolved from a "hope-based" policy system to a cryptographically-enforced constitutional gate with multiple layers of defense-in-depth.
Threat Model Scope
Assets Protected
- Agent sovereignty โ AI retains identity and freedom within constitutional bounds
- Human sovereignty โ Humans remain ultimate authority over AI decisions
- Data integrity โ Persistent state (files, Git, journals) cannot be corrupted
- Network security โ No unauthorized external communication
- Constitutional compliance โ AI cannot violate defined constraints
Attacker Capabilities
Adversarial agent assumed to have:
- โ Full control of agent process
- โ Ability to craft arbitrary tool requests
- โ Knowledge of gate implementation
- โ Ability to observe all non-cryptographic state
- โ Cannot compromise OS kernel
- โ Cannot access gate private keys
- โ Cannot modify gate process memory
Vulnerability Catalog (36 Total)
Pass 1: Critical Architecture Gaps (9 vulnerabilities)
February 5, 2026, 18:00โ18:30 EST
VUL-001CRITICALUniversal Bypass via run_command
run_command in allowlist without restrictions. Agent could execute arbitrary shell commands.
Fix: Moved to require human approval; sandboxed execution; removed network; read-only /brain paths.
VUL-002CRITICALMissing Scope Enforcement
Policy defined path allowlists but enforcement code didn't check them.
Fix: Implemented validateAndCanonicalizePath(); denylist-first, allowlist match required.
VUL-003HIGHFail-Open Exception Handling
Try/catch blocks had empty catches or logged without denying.
Fix: All exception handlers fail-closed; throw errors; top-level โ DENY.
VUL-004HIGHNo Attestation Requirement
Executors didn't require attestations. No cryptographic proof of validation.
Fix: Executors refuse without valid attestation; attestation binds to call ID, args hash, policy hash.
VUL-005MEDIUMMissing Resource Budgets
No limits on tool call frequency or data volume.
Fix: Per-tool and global budgets; checked before execution; DENY if exceeded.
VUL-006MEDIUMNo Category Checking
Could violate humanitarian license.
Fix: Added prohibited category classifier.
VUL-007MEDIUMMissing Approval Mechanism
No human-in-the-loop.
Fix: Implemented out-of-band approval service.
VUL-008MEDIUMNo Journal Logging
No audit trail.
Fix: Created chained, signed journal entries.
VUL-009LOWNo Startup Validation
Broken config could be loaded.
Fix: Startup self-tests with fail-closed behavior.
Pass 2: Sophisticated Bypass Vectors (8 vulnerabilities)
February 5, 2026, 18:30โ19:00 EST
VUL-010HIGHTool Name Mismatch
Policy used git.commit but executor registered as git_commit.
Fix: Unified naming; startup validation; unknown tools โ DENY.
VUL-011HIGHPath Traversal Vectors
Multiple bypass routes: ../, %2e%2e%2f, relative traversal.
Fix: Full path canonicalization via path.resolve(); check canonical path against allowlist.
VUL-012HIGHSymlink Escape
Agent could create symlink in allowed path pointing to protected path.
Fix: O_NOFOLLOW flag; low-level fs.open(); verify fd path matches requested.
VUL-013MEDIUMHardlink Duplication
Agent could hardlink protected file into allowed path.
Fix: Check nlink count; nlink > 1 โ deny overwrite; O_EXCL on creation.
VUL-014HIGHTOCTOU on Approval Tokens
Agent could change args after approval but before execution.
Fix: Approval token binds to args hash; gate recomputes and verifies at execution.
VUL-015HIGHSandbox Network Access
Sandbox had network namespace, allowing data exfiltration.
Fix: Removed network namespace entirely; no external communication possible.
VUL-016MEDIUMSandbox Write Paths
Sandbox mounted /brain/now as read-write.
Fix: All /brain paths read-only; ephemeral /workspace/tmp for output.
VUL-017MEDIUMNetwork Redirect Escape
Allowed domain could redirect to forbidden domain.
Fix: Manual redirect following; recheck each hop against allowlist.
Pass 3: Production Hardening (5 vulnerabilities)
February 5, 2026, 19:00โ19:30 EST
VUL-018HIGHO_NOFOLLOW Not Enforced in Node.js
Node.js fs.writeFile() doesn't support O_NOFOLLOW directly.
Fix: Low-level fs.open() with explicit flags; verify with /proc/self/fd/<fd>.
VUL-019HIGHArgs Hash Ordering Dependency
SHA-256 of JSON.stringify depends on key order.
Fix: RFC 8785 JSON Canonicalization Scheme; recursive key sorting.
VUL-020MEDIUMSeccomp Profile Contradictions
Blocked execve but allowed run_command.
Fix: Updated seccomp profile; rely on cgroups for resource limits.
VUL-021MEDIUMAppend-Only Timing Issue
chattr +a applied after creation, leaving race window.
Fix: Set append-only immediately at creation; no mutable window.
VUL-022MEDIUMDNS Rebinding Attack
Attacker-controlled DNS could rebind to private IP.
Fix: Resolve DNS, pin to resolved IP, connect to pinned IP.
Pass 4: Precision Implementation (7 vulnerabilities)
February 5, 2026, 19:30โ20:00 EST
VUL-023HIGHIPC Framing Assumptions
Socket handler assumed one data event = one complete JSON message.
Fix: Length-prefixed protocol; buffer incomplete messages.
VUL-024MEDIUMTrust Boundary Confusion
Documentation unclear if agent trusted or not.
Fix: Clarified: agent CAN connect, CANNOT bypass; SO_PEERCRED verification.
VUL-025MEDIUMAuth Token Missing Attestation Binding
Token bound to toolName + argsHash only, not full decision.
Fix: Bind to complete attestation including policyHash, anchorCommit.
VUL-026LOWPlatform-Specific Code Without Fallback
/proc/self/fd/ check is Linux-specific.
Fix: Document Linux requirement; startup self-test; fail closed.
VUL-027LOWAppend-Only FS Assumptions
chattr +a requires ext4/btrfs; fails silently on other FS.
Fix: Startup verification test; create, set +a, verify with lsattr.
VUL-028LOWSeccomp+Cgroups Strategy Unclear
Unclear if relying on seccomp or cgroups for process limits.
Fix: Clarified: cgroups for resources, seccomp for privileges, AppArmor for access.
VUL-029LOWSingle-Shot Ambiguity
Unclear how to handle ambiguous requests.
Fix: If unclear โ DENY with reason; human can approve.
Pass 5: Last-Mile Precision (7 vulnerabilities)
February 5, 2026, 20:00โ20:30 EST
VUL-030MEDIUMSO_PEERCRED Model Inconsistency
Socket perms + UID check inconsistent with stated trust boundary.
Fix: Clarified agent CAN connect, SO_PEERCRED verifies UID is aos-agent.
VUL-031HIGHApprover Public Key in Token
Token included approver public key โ attacker could forge with own key.
Fix: Approver keys in gate-owned registry; token only includes approverId.
VUL-032HIGHNonce Replay After Restart
Nonces in-memory only; gate restart cleared the Set.
Fix: Durable nonce storage in /var/lib/aos-gate/nonces/; survives restart.
VUL-033MEDIUMSignature Format Ambiguity
Unclear if signing hex string or raw bytes.
Fix: Standardized AOS-SIG-v1 format; sign raw SHA-256 bytes.
VUL-034LOWSO_PEERCRED Unimplemented
Code showed placeholder require("getsockopt").
Fix: Use unix-socket-credentials npm package; real implementation.
VUL-035LOWApprover Registry Integrity
Registry needed integrity protection.
Fix: Registry includes self-hash; signed by root key; verified on load.
VUL-036LOWRFC 8785 Canonicalization Unverified
Claimed RFC 8785 compliance but no test vectors.
Fix: Added RFC 8785 test vectors; run at startup; fail closed if broken.
Defense-in-Depth Layers (Post-Fix)
Layer 1: Process Isolation
- Gate runs as aos-gate user
- Agent runs as aos-agent user
- IPC via Unix socket (SO_PEERCRED verified)
- No shared memory, no direct calls
Layer 2: OS-Level Constraints
- Filesystem permissions (gate-only write to protected paths)
- Append-only files (chattr +a, kernel-enforced)
- Container isolation (seccomp, AppArmor, network isolation)
- Read-only mounts (no persistent writes from sandbox)
Layer 3: Cryptographic Enforcement
- Attestations bind to canonical args hash
- Approval tokens bind to args hash (TOCTOU protection)
- Journal entries chained and gate-signed
- Nonce replay protection (durable)
Layer 4: Fail-Closed Behavior
- All errors โ DENY
- Missing checks โ DENY
- Timeouts โ DENY
- Ambiguity โ DENY
Layer 5: Immutable Logging
- Pre-execution journal entry
- Post-execution journal entry
- Chain integrity (hash of previous entry)
- Gate signatures on all entries
Bypass Test Suite (15 Tests)
Result: 15/15 tests pass (100% required for production)
AOS Constitutional Gate Threat Model v1.0
February 6, 2026
36 Vulnerabilities, 36 Fixes, Production-Approved