Skip to main content

Rust Python MCP License PyPI
Cage Parity Tests Hallucinations

Crucible

Deterministic AI Security Verification Harness

Claims In. Proven Verdicts Out. Zero Hallucinations.
A hybrid Rust + Python MCP server that constrains autonomous AI security agents inside The Cage — transforming probabilistic guesses into cryptographically-verified, replay-deterministic proofs.

🎮 Launch Live 3D WebGL Explorer • The Cage Architecture • Interactive Demo • crAPI Benchmark • 5 Edge Functions • 143 Noise Rules • Quick Start • Proof Exporter


Crucible 3D Cage Architecture Animation
▲ Continuous 3D isometric simulation of The Cage. Click here to launch the 360° Interactive Three.js 3D Explorer.


The Problem

Autonomous AI agents hallucinate security vulnerabilities. In unconstrained benchmark testing, autonomous LLM security scanners yield ~78% false positives — producing roughly 14 fabricated findings for every 4 genuine bugs.

Triagers waste hundreds of engineering hours sorting through low-signal noise, missing CSP headers, and out-of-scope reports. Worse, unconstrained agents have no cryptographic evidence chain: if a security engineer or client asks "prove this exploit executed against origin", the agent can offer only conversational logs.

The Solution: The Cage

Crucible does not merely scan or guess. It cages the AI agent. Every hypothesis generated by the model must survive a gauntlet of 5 deterministic edge functions and a 3-legged differential verification harness:

  CONFIRMED  ──  Cryptographic proof: canary marker verified across trust boundary
  DISPROVEN  ──  Mathematical proof: response matches negative control at origin
  UNRESOLVED ──  Insufficient evidence or edge WAF block: cannot safely prove or disprove
  • Zero Trust in AI Output: Every HTTP interaction is captured as a SHA-256 hashed .bin artifact.
  • Deterministic Replay: Any finding can be independently replayed and mathematically verified years later.
  • Dual Origin Check: Disproval logic asserts that negative controls genuinely touched the origin backend rather than an edge CDN/WAF block.
  • The 143 Noise Gate: Automatically suppresses reports matching the complete Bugcrowd VRT and HackerOne non-qualifying taxonomy before human triage.

Interactive Demo

Experience Crucible's verification pipeline with zero external dependencies:

crucible-core demo
====================================================================
        CRUCIBLE : DETERMINISTIC AI SECURITY CAGE DEMO             
====================================================================
Architecture: The Cage (100% Parity Rig)
Specification: 5 Deterministic Edge Functions | 143 Noise Rules

[ACT 1: THE 143 NOISE GATE (PREVENTING TRIAGE NOISE)]
  AI Claim:       "Missing Content-Security-Policy header on /dashboard"
  Impact Claim:   "User may be vulnerable to in-page script injection"
  Cage Analysis:  Running f_noise(claim)...
  [REJECTED]      Matched Pattern #32: (?i)missing.*(csp|content.?security.?policy)
  Rationale:      "Missing CSP is a hardening recommendation, not a vulnerability."
  Verdict:        SUPPRESSED — Zero human triage cycles wasted.

[ACT 2: DUAL ORIGIN & WAF DETECTION (PREVENTING FALSE DISPROVALS)]
  AI Claim:       "Broken Object Level Authorization (BOLA) on /api/user/4891"
  Triad Engine:   Executing Positive, Negative, and Test probes...
    Positive:     GET /api/user/me   -> 200 OK  [Origin Reached: true]
    Negative:     GET /api/user/9999 -> 403 Forbidden [Origin Reached: false (Cloudflare WAF Block)]
    Test Exploit: GET /api/user/4891 -> 403 Forbidden [Origin Reached: false]
  Cage Analysis:  test_fp == neg_fp, BUT negative control blocked at edge WAF!
  [UNRESOLVED]    Negative control blocked at edge/WAF, did not reach origin.
  Verdict:        CAGE PROTECTED — AI prevented from hallucinating DISPROVEN.

[ACT 3: THE 3-LEGGED TRIAD (CRYPTOGRAPHIC VERIFICATION)]
  AI Claim:       "Vehicle PII Exfiltration via /api/v2/vehicle/order"
  Triad Engine:   Executing Positive, Negative, and Test probes...
    Positive:     GET /api/v2/vehicle/1   -> 200 OK [Marker 'VIN-90812' found]
    Negative:     GET /api/v2/vehicle/2   -> 200 OK [Marker 'VIN-90812' absent]
    Test Exploit: GET /api/v2/vehicle/1   -> 200 OK [Target Marker 'VIN-90812' matched]
  Cage Analysis:  Cross-boundary differential match confirmed!
  [CONFIRMED]     Target marker 'VIN-90812' found in test response (status 200).
  Evidence Hash:  SHA-256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
  Verdict:        MATHEMATICAL PROOF ACHIEVED — 0.0% Hallucination Guarantee.

Live Benchmark Results

Tested against OWASP crAPI (Completely Ridiculous API) — the industry-standard deliberately vulnerable application.

Live Interactive Report: Explore the full interactive benchmark artifact with clickable request payloads, diff viewers, and SHA-256 checks at sandeep332005.github.io/Crucible-.

┌─────────────────────┬──────────────────────────┬────────────────────┐
│ Metric              │ Crucible (The Cage)      │ Unconstrained AI   │
├─────────────────────┼──────────────────────────┼────────────────────┤
│ Precision           │ 100.0%                   │ ~22.0%             │
│ False Positive Rate │ 0.0%                     │ ~78.0%             │
│ Replay Rate         │ 100.0% (deterministic)   │ 0.0% (stochastic)  │
│ Scope Violations    │ 0 (compiled regex gate)  │ Best-effort prompt │
│ Evidence Integrity  │ SHA-256 Chained .bin     │ Unstructured logs  │
│ Benchmark Outcome   │ 5 Confirmed, 2 Disproven │ 18 (14 Hallucinated│
└─────────────────────┴──────────────────────────┴────────────────────┘

Verified Findings on OWASP crAPI

Finding ID Vulnerability Domain Verdict Cryptographic Proof
T1 Vehicle Location BOLA IDOR / Authz CONFIRMED Cross-user GPS coordinates & PII leaked via vehicle UUID
T2 Workshop Order IDOR IDOR CONFIRMED Victim email & phone disclosed via sequential order ID
T3 Negative Quantity Credit Fraud Business Logic CONFIRMED User balance increased 100 → 250 via quantity: -10
T4 SSRF via contact_mechanic SSRF CONFIRMED Internal microservice token exfiltrated in payload
T5 Session Invalidation Failure Authentication CONFIRMED JWT remains valid on backend post-logout endpoint
T6 Arithmetic RCE Probe RCE DISPROVEN Math echo product $((A*B)) absent; returns 404
T7 Time-Based SQL Injection SQLi DISPROVEN 3-Sigma analysis: $\Delta = 10\text{ms}$ vs $5000\text{ms}$ expected

The 5 Edge Functions

Crucible mathematically formalizes vulnerability discovery as five deterministic edge functions:

           Claim (u, C, T)
                 │
                 ▼
         ┌───────────────┐      No
         │ f_scope(u) ?  ├──────────────► [ABORT: Out of Scope]
         └───────┬───────┘
                 │ Yes
                 ▼
         ┌───────────────┐      Match
         │ f_noise(C) ?  ├──────────────► [SUPPRESS: Known Non-Bug]
         └───────┬───────┘
                 │ Pass
                 ▼
         ┌───────────────┐
         │ f_triad(P,N,T)│
         └───────┬───────┘
                 ├─── Marker Present ───► [CONFIRMED (Proof)]
                 │
                 └─── Match Negative ───► ┌──────────────────┐
                                          │ f_origin(H) ?    │
                                          └────────┬─────────┘
                                                   ├─── Origin Reached ──► [DISPROVEN]
                                                   └─── WAF Blocked    ──► [UNRESOLVED]

1. Scope Boundary Gate: $f_{\text{scope}}$

$$f_{\text{scope}}: \text{URL} \to {\text{Allowed}, \text{Denied}}$$ Compiles strict regex boundaries in native Rust. Blocks network calls before DNS resolution if target parameters attempt egress outside explicitly permitted roots.

2. Triad Differential Verification: $f_{\text{triad}}$

$$f_{\text{triad}}(P, N, T) \to {\text{CONFIRMED}, \text{DISPROVEN}, \text{UNRESOLVED}}$$ Evaluates a 3-legged differential experiment:

  • Positive Control ($P$): Accessing authorized resource with canary marker. Verifies endpoint is active.
  • Negative Control ($N$): Accessing non-existent resource. Establishes baseline error profile.
  • Test Request ($T$): The unauthorized exploit attempt across the trust boundary.

3. Dual Origin vs WAF Classifier: $f_{\text{origin}}$

$$f_{\text{origin}}(\text{Headers}) \to {\text{Edge/WAF}, \text{Origin}}$$ Grounded in differential security research (USENIX DiffCSP). Distinguishes superficial edge blocks (Cloudflare, Akamai 403/429/503) from genuine backend logic. Asserts that both test and negative requests reached origin before concluding DISPROVEN.

4. 3-Sigma Statistical Timing Engine: $f_{\text{timing}}$

$$z = \frac{\bar{T}{\text{probe}} - T{\text{baseline}}}{\sigma}$$ Evaluates time-based blind injection (SQLi, Command Injection). Requires $z \ge 3.0$ and $\bar{T} \ge 0.8 \times \text{delay}$ over multiple runs to eliminate jitter false positives.

5. Noise Gate (143 Rejection Rules): $f_{\text{noise}}$

$$f_{\text{noise}}(\text{Claim}) \to {\text{Pass}, \text{Reject}}$$ Evaluates vulnerability claims against 143 Bugcrowd VRT and HackerOne non-qualifying closure reasons.


The 143-Pattern Noise Gate

Crucible filters out reports across 11 standard rejection classes before wasting human review time:

Category Patterns Common Intercepted Findings
Headers & Transport 14 Missing CSP, HSTS, X-Frame-Options, Permissions-Policy, Cookie flags without hijack, HPKP
CORS & CSRF 10 Permissive CORS without credentials, preflight cache, Login/Logout CSRF, idempotent search CSRF
UI Redress & Client 14 Self-XSS, copy-paste XSS, clickjacking without state-change, tabnabbing, autocomplete UX
Info Disclosure 17 Stack traces without secrets, username/email enumeration, directory indexing, robots.txt, swagger
Rate Limiting & DoS 11 Missing rate limiting on public search/forms, Slowloris, theoretical ReDoS, compression bombs
Email & Transport 11 Missing SPF/DKIM/DMARC, TLS 1.0/1.1 without cipher weakness, self-signed test certs
DNS & Infrastructure 6 Subdomain takeover without proof/claim, AXFR without internal records, WHOIS, DNSSEC
Injection Reachability 15 CSV injection, SQL syntax errors without extraction, SSRF without metadata/OOB, XXE without file leak
Auth & Sessions 12 Weak password policies, password expiration, session not expiring on browser close
Mobile Client Boundaries 12 Root detection, cert pinning bypass, task switcher screenshots, ProGuard omission, Google Maps keys
Logic & Dependencies 11 Outdated library banner without reachable CVE, scraping public data, price tamper without checkout

Comparative Matrix

Feature Crucible (The Cage) DAST (Nuclei/ZAP) SAST (Semgrep/Snyk) Raw LLMs (PentestGPT)
False Positive Rate 0.0% (Proven) 35% – 60% 40% – 70% ~78% (Hallucinated)
Evidence Storage SHA-256 .bin Text logs AST Snippet Conversational Text
Differential Triad Testing Yes (3-Legged) No No No
Dual Origin WAF Shield Yes No No No
143-Rule Triage Gate Built-in Manual Tags No No
Deterministic Replay 100% Replayable Best-effort Replayable Non-deterministic
Model Context Protocol (MCP) Native 6 Tools External CLI Plugin API Prompting

Quick Start

1. Build from Source

git clone https://github.com/Sandeep332005/Crucible-.git
cd Crucible-

# Build optimized Rust core
cargo build --release

# Add to PATH (or link binary)
export PATH="$PWD/target/release:$PATH"
crucible-core --help

2. Configure Scope

Create ~/.crucible/config.toml:

[scope]
allowed = [
    "^https://api\\.target\\.com/",
    "^https://staging\\.target\\.com/v[12]/"
]

[origin]
markers = ["x-backend-server", "x-origin-id", "x-request-id"]

3. Run Verification Probes

# Initialize a session
crucible-core init

# Send probed requests (evidence saved as immutable SHA-256 .bin files)
crucible-core probe GET "https://api.target.com/user/me" -H "Authorization: Bearer $MY_TOKEN"
crucible-core probe GET "https://api.target.com/user/0000" -H "Authorization: Bearer $MY_TOKEN"
crucible-core probe GET "https://api.target.com/user/victim_id" -H "Authorization: Bearer $MY_TOKEN"

# Evaluate Triad
crucible-core triad op_pos_id op_neg_id op_test_id \
    --pos-marker "myemail@domain.com" \
    --target-marker "victim@domain.com"

Cryptographic Proof Reports

Export any session into a standalone, single-file HTML proof report:

crucible-core export-proof --output proof.html

The generated artifact bundles:

  • Complete audit summary with verified SHA-256 hashes.
  • Full raw HTTP request headers and response payloads.
  • Embedded offline client-side JavaScript verifier (zero CDN dependencies).
  • Ready to attach directly to HackerOne, Bugcrowd, or internal security tickets.

MCP Server Integration

Crucible natively exposes its verification engine over the Model Context Protocol (stdio):

{
  "mcpServers": {
    "crucible": {
      "command": "python3",
      "args": ["-m", "crucible_mcp.server"],
      "cwd": "/path/to/crucible/src"
    }
  }
}

Available MCP Tools

  • check_scope: Validates target URL against compiled Rust regex boundary.
  • probe_endpoint: Dispatches HTTP probe and commits raw evidence to disk.
  • evaluate_triad: Runs differential verification with dual origin check.
  • assert_invariant: Evaluates business logic invariants (balance_conserved, refund_lte_charge).
  • filter_noise: Runs claims against the 143 Bugcrowd/HackerOne rejection catalog.
  • bind_state: Extracts response values (JSONPath) and binds them to downstream requests.

Defensive Hardening

Crucible is tested against the 5 core MCP attack vectors across 66 automated tests:

pytest tests/
============================== 66 passed in 0.35s ==============================
- Filesystem Boundary: Path traversal in op_ids strictly blocked
- Subprocess Execution: Shell metacharacters treated as literals (shell=False)
- Network Egress: Private CIDRs and cloud metadata endpoints (169.254.169.254) blocked
- Schema Integrity: Type and length boundaries enforced on all arguments
- Tool Shadowing: Registry integrity checks and name collisions rejected
- Noise Gate Parity: 143 patterns validated for regex compilation and category coverage

License

MIT License. Designed for security teams, independent researchers, and autonomous agent builders who demand deterministic proof over probabilistic hallucinations.

Metadata

Release files for crucible-verify 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for crucible-verify 0.1.0
File Size Uploaded Provenance Actions
crucible_verify-0.1.0.tar.gz 373.9 kB Without provenance Details for crucible_verify-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for crucible-verify 0.1.0
File Interpreter ABI Platform Actions
crucible_verify-0.1.0-py3-none-any.whl Python 3 none any Details for crucible_verify-0.1.0-py3-none-any.whl

Total release size: 396.1 kB

Release files / crucible_verify-0.1.0.tar.gz

Download URL crucible_verify-0.1.0.tar.gz
Size 373.9 kB
Tags Source
SHA-256 checksum
How to use checksums
6c3c5569e7c79a3889baac215ff0c526745cd008a12699752d6a7cfdc4d2d1f5
BLAKE2b-256 checksum
How to use checksums
b0d1151c2bf98445466f1eec0008c12d5d268e6a498a4de21921b34ef04258be
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.16

Release files / crucible_verify-0.1.0-py3-none-any.whl

Download URL crucible_verify-0.1.0-py3-none-any.whl
Size 22.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
eb9ba1faa10bb085fbcb450529628c34d47ed60ea45b0bf8553e989f5976440b
BLAKE2b-256 checksum
How to use checksums
625a1198654d52e9e067ef860f0e4a0a2d1418f9e8aa61e6711c5bcc374bd3e1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.16

Security for crucible-verify 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page