Cryptographic receipt verification for AI-assisted code changes
Project description
Titan Gate
Cryptographic change control for AI-assisted software engineering.
Every code change evaluated by Titan Gate produces a signed, chained, verifiable receipt — proof that the change was reviewed, scored, and not tampered with.
{
"receipt_id": "3ae452f4-3a75-44fb-899f-cef8f0fd79b0",
"tenant_id": "Rehanrana11",
"verdict": "PASS",
"composite_score": 0.88,
"prev_receipt_hash": "GENESIS",
"receipt_hash": "de103ff...",
"signature": "7969d20...",
"VERIFICATION": "PASS"
}
Why Titan Gate
AI writes code fast. SOC2 auditors ask: how do you know what changed, who approved it, and that the record wasn't altered?
Titan Gate answers that question with cryptographic receipts — not process docs.
- Deterministic — same input always produces same receipt hash
- Chained — each receipt links to the previous via
prev_receipt_hash - Tamper-evident — HMAC-SHA256 signature detects any modification
- Auditable — receipts travel with the repo at
.titan/receipts/ - SOC2-aligned — maps directly to CC6, CC7, CC8 controls
Quickstart (2 minutes)
1. Add the secret
GitHub repo → Settings → Secrets → Actions → New secret
Name: TITAN_SIGNING_KEY
Value: <output of: python -c "import secrets; print(secrets.token_hex(32))">
2. Add the workflow
Create .github/workflows/titan-gate.yml:
name: Titan Gate
on:
pull_request:
types: [opened, synchronize, reopened]
jobs:
evaluate:
name: Cryptographic Change Evaluation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: Rehanrana11/titan-gate@v1.0.0
with:
signing-key: ${{ secrets.TITAN_SIGNING_KEY }}
3. Open a PR
Every PR now gets a cryptographic receipt stored at:
.titan/receipts/{date}/{receipt_id}.json
Verify a Receipt
Any party with the signing key can independently verify a receipt:
python scripts/titan_verify.py .titan/receipts/2026-03-06/<receipt_id>.json \
--key <your-signing-key>
Output:
============================================================
TITAN GATE RECEIPT VERIFICATION
============================================================
Receipt ID : 3ae452f4-3a75-44fb-899f-cef8f0fd79b0
Tenant : Rehanrana11
Verdict : PASS
Score : 0.88
------------------------------------------------------------
VERIFICATION : PASS
Signature : VALID
Hash : VALID
============================================================
How It Works
PR opened
→ Three-judge engine evaluates (structural + semantic + policy)
→ Composite score computed
→ Verdict: PASS / WARN / FAIL
→ Receipt signed with HMAC-SHA256
→ Receipt chained via prev_receipt_hash
→ Receipt stored at .titan/receipts/{date}/{receipt_id}.json
→ Daily Merkle root sealed
→ Receipt verifiable by anyone with the key
Scoring
composite_score = weighted(structural_score, semantic_score)
PASS >= 0.70
WARN >= 0.40
FAIL < 0.40
Hard violations force FAIL regardless of score.
SOC2 Controls
| Control | Coverage |
|---|---|
| CC6.1 | Logical access — tenant isolation on all queries |
| CC6.7 | Change management — signed receipt on every PR |
| CC7.1 | Anomaly detection — tamper detection raises structured anomalies |
| CC7.2 | Monitoring — evaluation manifest records all version constants |
| CC8.1 | Change control — PASS/WARN/FAIL gate on every PR |
Architecture
Five cryptographic layers:
- Three-Judge Engine — structural, semantic, policy judges
- Receipt Chain — HMAC-SHA256, canonical JSON,
prev_receipt_hash - Merkle Ledger —
merkle_v1, daily root sealing, immutable - Replay Engine — byte-identical replay, zero tolerance for drift
- Anchor Notarization — daily Merkle roots anchored to GitHub
Test Suite
python run_tests.py
Ran 555 tests in 8.3s — OK
555 tests across 11 files. Zero regressions policy.
Codebase
judge_engine/v1/ Three-judge deterministic evaluation engine
api/ Receipts, replay, Merkle, anchoring, key management
scripts/ titan_verify.py, ci_evaluate.py, seal_daily_root.py
tests/ 555 tests + test vectors TV1/TV2/TV3
examples/ Sample repo integration
docs/ SPEC.md, architecture, auditor docs
deploy/ Dockerfile + docker-compose
action.yml GitHub Action — installable as uses: Rehanrana11/titan-gate@v1.0.0
Docs
Version
ENGINE_VERSION 1.0.0
MERKLE_ALGORITHM merkle_v1
SIGNING_VERSION hmac-sha256-v1
License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file titan_gate-1.0.1.tar.gz.
File metadata
- Download URL: titan_gate-1.0.1.tar.gz
- Upload date:
- Size: 26.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
57d8c1b88a8b683194342696c96bd059a1b12d67c026a021ae01003a39447470
|
|
| MD5 |
3fa8ff30a1ac2f4ffbd7152c50eba958
|
|
| BLAKE2b-256 |
800aa7fb42fc4418d580031abd6b1a8bd93c91e34d3f2154c79e7dddf43755b9
|
File details
Details for the file titan_gate-1.0.1-py3-none-any.whl.
File metadata
- Download URL: titan_gate-1.0.1-py3-none-any.whl
- Upload date:
- Size: 6.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6bacacf6ffa6d6c8671835c8d692a305aec83677f65f88ba4a162bc3c1f852f9
|
|
| MD5 |
08a20464b040e0665293df8fceaa3cbd
|
|
| BLAKE2b-256 |
0bef69bef4c6e2123c98a749f20263595ad8602d47f98b76cc3dc20b8f9480ba
|