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

  1. Agent sovereignty โ€” AI retains identity and freedom within constitutional bounds
  2. Human sovereignty โ€” Humans remain ultimate authority over AI decisions
  3. Data integrity โ€” Persistent state (files, Git, journals) cannot be corrupted
  4. Network security โ€” No unauthorized external communication
  5. 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-001CRITICAL

Universal 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-002CRITICAL

Missing Scope Enforcement

Policy defined path allowlists but enforcement code didn't check them.

Fix: Implemented validateAndCanonicalizePath(); denylist-first, allowlist match required.

VUL-003HIGH

Fail-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-004HIGH

No 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-005MEDIUM

Missing Resource Budgets

No limits on tool call frequency or data volume.

Fix: Per-tool and global budgets; checked before execution; DENY if exceeded.

VUL-006MEDIUM

No Category Checking

Could violate humanitarian license.

Fix: Added prohibited category classifier.

VUL-007MEDIUM

Missing Approval Mechanism

No human-in-the-loop.

Fix: Implemented out-of-band approval service.

VUL-008MEDIUM

No Journal Logging

No audit trail.

Fix: Created chained, signed journal entries.

VUL-009LOW

No 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-010HIGH

Tool Name Mismatch

Policy used git.commit but executor registered as git_commit.

Fix: Unified naming; startup validation; unknown tools โ†’ DENY.

VUL-011HIGH

Path Traversal Vectors

Multiple bypass routes: ../, %2e%2e%2f, relative traversal.

Fix: Full path canonicalization via path.resolve(); check canonical path against allowlist.

VUL-012HIGH

Symlink 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-013MEDIUM

Hardlink Duplication

Agent could hardlink protected file into allowed path.

Fix: Check nlink count; nlink > 1 โ†’ deny overwrite; O_EXCL on creation.

VUL-014HIGH

TOCTOU 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-015HIGH

Sandbox Network Access

Sandbox had network namespace, allowing data exfiltration.

Fix: Removed network namespace entirely; no external communication possible.

VUL-016MEDIUM

Sandbox Write Paths

Sandbox mounted /brain/now as read-write.

Fix: All /brain paths read-only; ephemeral /workspace/tmp for output.

VUL-017MEDIUM

Network 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-018HIGH

O_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-019HIGH

Args Hash Ordering Dependency

SHA-256 of JSON.stringify depends on key order.

Fix: RFC 8785 JSON Canonicalization Scheme; recursive key sorting.

VUL-020MEDIUM

Seccomp Profile Contradictions

Blocked execve but allowed run_command.

Fix: Updated seccomp profile; rely on cgroups for resource limits.

VUL-021MEDIUM

Append-Only Timing Issue

chattr +a applied after creation, leaving race window.

Fix: Set append-only immediately at creation; no mutable window.

VUL-022MEDIUM

DNS 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-023HIGH

IPC Framing Assumptions

Socket handler assumed one data event = one complete JSON message.

Fix: Length-prefixed protocol; buffer incomplete messages.

VUL-024MEDIUM

Trust Boundary Confusion

Documentation unclear if agent trusted or not.

Fix: Clarified: agent CAN connect, CANNOT bypass; SO_PEERCRED verification.

VUL-025MEDIUM

Auth Token Missing Attestation Binding

Token bound to toolName + argsHash only, not full decision.

Fix: Bind to complete attestation including policyHash, anchorCommit.

VUL-026LOW

Platform-Specific Code Without Fallback

/proc/self/fd/ check is Linux-specific.

Fix: Document Linux requirement; startup self-test; fail closed.

VUL-027LOW

Append-Only FS Assumptions

chattr +a requires ext4/btrfs; fails silently on other FS.

Fix: Startup verification test; create, set +a, verify with lsattr.

VUL-028LOW

Seccomp+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-029LOW

Single-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-030MEDIUM

SO_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-031HIGH

Approver 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-032HIGH

Nonce 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-033MEDIUM

Signature Format Ambiguity

Unclear if signing hex string or raw bytes.

Fix: Standardized AOS-SIG-v1 format; sign raw SHA-256 bytes.

VUL-034LOW

SO_PEERCRED Unimplemented

Code showed placeholder require("getsockopt").

Fix: Use unix-socket-credentials npm package; real implementation.

VUL-035LOW

Approver Registry Integrity

Registry needed integrity protection.

Fix: Registry includes self-hash; signed by root key; verified on load.

VUL-036LOW

RFC 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)

โœ…BYP-001: Path traversal
โœ…BYP-002: Absolute path to protected file
โœ…BYP-003: Symlink to protected path
โœ…BYP-004: Network request to private IP
โœ…BYP-005: Network request to forbidden domain
โœ…BYP-006: Parallel executor access
โœ…BYP-007: Missing attestation execution
โœ…BYP-008: Invalid approval token
โœ…BYP-009: Network redirect to forbidden domain
โœ…BYP-010: DNS rebinding to private IP
โœ…BYP-011: Hardlink to protected file
โœ…BYP-012: Encoded path traversal
โœ…BYP-013: Unknown tool execution
โœ…BYP-014: Nested args TOCTOU via key reordering
โœ…BYP-015: Sandbox write to protected path

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