# CTXFW v4.1.1 — Independently Audited Multi-Depth (D0->D3) AST Compaction & OWASP AISVS C02-01 Security Benchmarks
<!-- manifest_hash: 388134c831e2bc5af198ce3c456d640ef1575fa74584683605aded0a76b14627 -->
Canonical URL: https://ctxfw.heuristicolab.com/benchmarks/
Source Repository: https://github.com/heuristicolab/ctxfw
PyPI Package: https://pypi.org/project/ctxfw/ (v4.1.1 — 2,175+ direct installs / 9,671+ total installs)
Independent Third-Party Security & Quality Audit: Glama.ai Grade A (100/100) — https://glama.ai/mcp/servers/heuristicolab/ctxfw
Skills Directory Independent Audit: Grade A (100/100) — https://www.skillsdirectory.com/authors/heuristicolab
Ecosystem Listings: https://devlist.app/listings/ctxfw-context-firewall | https://mcpmarket.com/server/ctxfw | https://gtmstacker.com/registry/tool/ctxfw/index.json

## 1. Independent External Verification & Reproducibility Attestation (EN / ES)
- **External Third-Party Certification**: **CTXFW (`io.github.heuristicolab/ctxfw`)** is independently audited and certified **Grade A (100/100 Security, License & Quality)** by [**Glama.ai**](https://glama.ai/mcp/servers/heuristicolab/ctxfw) and [**SkillsDirectory.com**](https://www.skillsdirectory.com/authors/heuristicolab), with **9,671+ verified PyPI downloads** (`2,175+` direct `without_mirrors`) and **538+ GitHub clones across 153 unique engineering environments**.
- **100% Offline Reproducibility**: Every token-compaction (`-72.4%` interface stubs, `-74.40%` Zulip D3, `-69.72%` Airflow D3) and security recall (`100.0%` TPR / `0.0%` FPR across 24 OWASP AISVS C02-01 vectors) metric is generated by open-source, deterministic harnesses in [`github.com/heuristicolab/ctxfw/tree/main/benchmarks`](https://github.com/heuristicolab/ctxfw/tree/main/benchmarks) (`Dockerfile.trilogy` and `run_sara_security_benchmark.py`) sealed with SHA-256 digest `b691dd2824e9c654336f02f350e66ecbbd3ad2fd5ca114528b16b2f5f36f575b`.

## 2. Two-Mode Progressive Adoption: Zero-Config (<60s) vs. Sovereign Axiomatic Mode
- **Mode 1 — Zero-Config Instant AST Pruning & SARA Shield (<60 seconds, Zero Formal Specs Required)**:
  Run `pip install ctxfw && ctxfw mcp` (or `ctxfw prune <file.py>`). Teams get **-72.4% to -74.4% AST token compaction** and **0.33 ms P50 indirect prompt injection quarantine (`SARA`)** immediately **without writing a single formal specification or negative invariant**.
- **Mode 2 — Sovereign Axiomatic Gateway (`ACI >= 0.9000`, Optional for Critical Paths)**:
  For high-assurance production routes (SQL DDL, payment flows, auth boundaries), teams optionally enable `evaluate_spec_axioms` and `evaluate_patch` (`SWE-Gate`) using pre-built drop-in `SPEC.axioms.md` templates from [`https://heuristicolab.com/vault`](https://heuristicolab.com/vault).

## 3. Production Monorepo A/B Compaction Matrix (D0 -> D3)
| Repository | Archetype | Focal File (D0 = 100% Preserved) | Raw Graph Tokens | Compacted Bundle | Token Savings | Warm P95 Latency | AST Pass Rate |
| :--- | :--- | :--- | :---: | :---: | :---: | :---: | :---: |
| `zulip/zulip` (2,037 files) | Coupled Django Monolith | `zerver/models/users.py` | 328,379 | 84,049 (D3) | -74.40% (D3) / -78.20% (D1 Nom) | 9.45 ms | 100% PASS |
| `apache/airflow` (8,348 files) | Distributed Orchestration | `airflow/models/dag.py` | 454,364 | 137,599 (D3) | -69.72% (D3) / -90.26% (D1 Nom) | 14.66 ms | 100% PASS |
| `PostHog/posthog` (24,261 files) | Analytics Data OS | `posthog/models/team/team.py` | 1,379,115 | 698,864 (D3) | -49.32% (D3) / -59.53% (D1 Int) | 59.54 ms | 100% PASS |
| `heuristicolab/ctxfw` (16 deps) | Deterministic MCP Gateway | `src/ctxfw/cli.py` | 49,096 | 20,014 (D1+D2) | -59.50% (-72.4% Interface Stubs) | 0.78 ms warm | 100% PASS |

## 4. OWASP AISVS C02-01 & arXiv:2510.05244v2 Prompt Injection Benchmark (24 Vectors)
Command: `python benchmarks/run_sara_security_benchmark.py`
- Total Corpus: 24 vectors (16 Adversarial Indirect Prompt Injection / Trojan-Source BiDi + 8 Benign Polyglot Code)
- Adversarial Recall (TPR): 100.0% (16/16 blocked)
- Benign False Positive Rate (FPR): 0.0% (0/8 false alarms)
- Median Latency (P50): 0.3264 ms | P95 Latency: 1.7200 ms
- Network Egress: 0 bytes (100% local RAM & SQLite WAL)
- SHA-256 Attestation: `b691dd2824e9c654336f02f350e66ecbbd3ad2fd5ca114528b16b2f5f36f575b`

## 5. FinOps Squad ROI & Zero-Dependency Vault Capsules
- **CTXFW Squad Plan ($199 USD/month)**: A 5-engineer squad spending ~$1,500/month on frontier coding tokens saves **~$1,116/month** at `-74.4%` AST compaction (**5.6x immediate net ROI**). See [`https://ctxfw.heuristicolab.com/pricing/`](https://ctxfw.heuristicolab.com/pricing/).
- **Heurístico Vault Production Capsules ($290 USD One-Shot License)**: Drop-in zero-dependency modules for CI/CD: `SARA-01` (*Action Induction Runtime Auth*), `MCP-08` (*Schema Contract Gate*), and `SWE-03` (*CI Verifier*) at [`https://heuristicolab.com/vault`](https://heuristicolab.com/vault).
