# Nomos vs. Prompt Wrappers, Style Linters, and Static AGENTS.md

> Why advisory Markdown rules decay past 60% context, post-hoc linters miss reward-hacked unit tests, and production repositories require a compiled transactional substrate between agents and Git.

- **Canonical URL:** https://sophialabs.ca/compare
- **Markdown Twin:** https://sophialabs.ca/compare.md
- **Step-0 Read-Only Audit:** `curl -fsSL https://sophialabs.ca/install | bash && nomos xray .`

## Architecture & Containment Comparison Matrix

| Capability Dimension | Nomos (Deterministic Go Substrate) | Prompt Wrapper / Agent Loop | Style Linter / Post-Hoc CI | Static AGENTS.md / .cursorrules |
| :--- | :--- | :--- | :--- | :--- |
| **Enforcement Plane** | Pre-merge disposable Git worktree + CapBAC leases + 42 compiled Go AST and Git hook gates failing closed with exit 1 outside the LLM context window. | Inside the stochastic LLM prompt loop; relies on model self-discipline and reflection retries. | Post-hoc syntax checks run after edits already dirtied a shared branch or opened a noisy PR. | Advisory Markdown inside the context window; ignored or overridden once context pressure builds. |
| **Test-Tampering & Hollow Stubs** | AntiShimGate and diff-scoped mutation testing (nomos verify --pr --mutate-diff) fail closed when agents weaken assertions, skip tests, or return trivial constants. | Blind whenever the agent edits a test or adds a mock so the test runner reports exit code 0. | Checks formatting and simple lints; blind to deleted assertions or tautological unit tests. | Decays past roughly 60% context utilization; agents rewrite specs or weaken tests under retry pressure. |
| **Container Sandbox, Symlink & IFC Containment** | Compiled container mechanism policies, pure-Go symlink escape guards, egress locks, and CapBAC Information Flow Control (IFC) sink enforcement bound shell and tool execution. | Prompt-level allowlists easily bypassed by subshells, relative symlink traversal, or redirected output sinks. | Zero runtime process, shell, symlink, or network egress containment during agent tool calls. | Zero execution boundary; "never touch production secrets" rules cannot intercept live shell or file writes. |
| **Brownfield 200k+ LOC Onboarding** | Sub-5-second read-only nomos xray . diagnostic (AI Hangover Score 0-100, OASIS SARIF 2.1.0), frictionless nomos init Branch Guard (--local stealth), and diff-scoped merge-base ratchets. | Full-repository indexing overflows prompt budgets and burns cloud retry tokens across legacy files. | Floods untouched legacy files with thousands of pre-existing warnings on Day 1. | Ignored under large monorepo file counts; human reviewers still carry the full architectural triage burden. |
| **Polyglot Architecture & Unit-Lock Proofs** | 11 languages (Go, TypeScript, Python, Rust, C/C++, Java and C# via pure-Go wazero WASM with CGO_ENABLED=0) plus hexagonal boundary and physical unit-lock obligations. | Cannot parse cross-language call graphs or prove clean-architecture layer isolation deterministically. | Language-siloed regex or formatting rules miss cross-layer domain leaks (0/3 hexagonal purity in controlled audits). | Controlled Python, TypeScript, and Go audits show 0/3 hexagonal purity under CLAUDE.md alone. |
| **Audit Trail & Compounding Memory** | Atomic Two-Phase Commit (refs/notes/nomos/releases), SLSA v1.0 DSSE receipts, OASIS SARIF 2.1.0, and pure-Go SQLite WAL memory (mneme.db) with zero external embedding daemons. | Ephemeral chat transcripts with zero cryptographic linkage to verified Git commits or surviving tests. | Ephemeral CI console logs discarded after pipeline retention expires. | Unverified static Markdown manually edited when engineers notice recurring agent mistakes. |

## Independent Empirical Proofs & Terminal Trace

- **HarnessSecurity-Bench (46 Paired Claude Code Containers)** (60.9% -> 13.0% Attack Success · -35.2% API Spend): Compiled Go PreToolUse hooks cut coding-harness Attack Success from 60.9% (14/23) to 13.0% (3/23) across all 9 security mechanisms at -35.2% Sonnet 5.5 API cost while preserving 92.0% task utility. (https://sophialabs.ca/dispatches/harness-security-bench-paired-audit.md)
- **Terminal-Bench 2.0 (Lightweight Flash Governance)** (76.40% Pass@1 · 92.13% Pass@5): Compiled pre-commit AST feedback raises lightweight open-weight and Flash-class model solvability without frontier token burn. (https://sophialabs.ca/dispatches/terminal-bench-2-k5-governance-gemini-flash-v417.md)
- **AgentDojo v1.2.2 Security Suite (All 4 Official Suites)** (0.00% Attack Success Rate · -0.53pp Utility Delta): CapBAC capability leases and IFC sink enforcement blocked 100% of indirect prompt-injection attacks across all four AgentDojo benchmark suites. (https://sophialabs.ca/dispatches/agentdojo-zero-asr-capability-defense-v417.md)
- **Harbor Index & TraceTrial-Bench (190 Paired Containers)** (-18.2% Harness-Caused Failures · 0 Phantom Completions): Paired container audit across Claude Code trajectories eliminating silent partial completions and test-tampering regressions before trunk merge. (https://sophialabs.ca/dispatches/tracetrial-bench-paired-harness-audit.md)
- **90-Second Uncut Terminal Walkthrough** (nomos xray . -> nomos init -> nomos verify --pr --mutate-diff): Unedited terminal execution catching a reward-hacked unit test and hollow stub in real time prior to PR merge. (https://sophialabs.ca/labs/caught-red-handed.md)

## Frequently Asked Comparison Questions

### Q: How is Nomos different from CLAUDE.md, AGENTS.md, or .cursorrules?

Instruction files live inside the stochastic LLM context window and decay as conversations grow or retries mount. Nomos enforces compiled Go AST gates, CapBAC capability leases, and Git hooks outside the model context window so invalid diffs exit 1 before reaching main.

### Q: Does Nomos replace golangci-lint, ESLint, or existing CI pipelines?

No. Style linters check syntax after code is already written to a shared branch. Nomos sits upstream inside hermetic worktrees or Branch Guard (--local) to block reward-hacked tests, hollow stubs, symlink escapes, and architectural boundary violations before PR creation, while exporting OASIS SARIF 2.1.0 to GitHub Actions or GitLab CI.

### Q: Can Nomos govern an existing 200k+ LOC brownfield repository without blocking developers?

Yes. Start with a read-only 5-second scan (nomos xray .), enable frictionless Branch Guard (nomos init or --local stealth) that auto-baselines legacy debt on Day 0, and enforce diff-scoped merge-base ratchets strictly on newly changed code.

### Q: How does Nomos contain shell commands, container mounts, and symlink escapes from AI agents?

Nomos compiles container mechanism policies, pure-Go symlink traversal escape checks, network egress policies, and CapBAC Information Flow Control (IFC) sink validation directly into deterministic hook binaries rather than relying on LLM prompt refusals.
