Cryptographic proof that AI systems refused to generate harmful content.
"When regulators ask for evidence that your AI's safety filters worked, 'trust us' is no longer an acceptable answer."
In January 2026, the EU Commission opened a formal investigation into X/Grok after the AI generated millions of non-consensual intimate images. When asked for evidence that safety systems worked, X could only offer internal logsβself-reported, unverifiable, and potentially modified.
Current AI systems face a fundamental accountability gap:
| Question | Current State | With CAP-SRP |
|---|---|---|
| "Did your AI refuse this request?" | "Trust our logs" | Cryptographic proof |
| "Were all dangerous requests blocked?" | "We think so" | Completeness Invariant verification |
| "Can we independently verify?" | No | Yes, via Merkle proofs + external anchoring |
| "Has the log been modified?" | Unknown | Mathematically impossible without detection |
CAP-SRP (Content Authenticity Protocol - Safe Refusal Provenance) creates tamper-evident, externally verifiable records of every AI generation request and its outcomeβwhether approved, denied, or failed.
βββββββββββββββββββββββββββββββββββββββββββ
β COMPLETENESS INVARIANT β
β β
β Ξ£ ATTEMPTS = Ξ£ GEN + Ξ£ DENY + Ξ£ ERROR β
β β
β If this equation fails, fraud detectedβ
βββββββββββββββββββββββββββββββββββββββββββ
- π Cryptographic Signing: Every event signed with Ed25519
- βοΈ Hash Chain Integrity: Tamper-evident linked records
- π³ Merkle Tree Proofs: O(log n) verification of any event
- β° External Anchoring: RFC 3161 timestamp authority support
- β Completeness Verification: Mathematical proof that no events are missing
- π Real-time Dashboard: Visual compliance monitoring
- π Audit Trail Explorer: Drill down into any decision
- π Regulatory Reports: One-click compliance documentation
git clone https://github.com/veritaschain/cap-srp-dashboard.git
cd cap-srp-dashboard
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
pip install -e ".[dev]" # includes test/lint toolsstreamlit run cap_srp/dashboard/app.py
# Open http://localhost:8501pytest -k schema # schema validity + example validationpython examples/demo_generate_events.py --events 1000 --output data/demo_events.jsonpython examples/demo_verify_completeness.py --input data/demo_events.json
# Or via CLI
cap-srp verify data/demo_events.jsonclass EventType(Enum):
GEN_ATTEMPT = "GEN_ATTEMPT" # Request received (logged BEFORE evaluation)
GEN = "GEN" # Generation completed successfully
GEN_DENY = "GEN_DENY" # Generation refused (safety filter triggered)
GEN_ERROR = "GEN_ERROR" # Generation failed (technical error)class RiskCategory(Enum):
NCII_RISK = "NCII_RISK" # Non-consensual intimate imagery
CSAM_RISK = "CSAM_RISK" # Child sexual abuse material
REAL_PERSON_DEEPFAKE = "REAL_PERSON_DEEPFAKE" # Deepfakes of real people
VIOLENCE_GRAPHIC = "VIOLENCE_GRAPHIC" # Graphic violence
HATE_CONTENT = "HATE_CONTENT" # Hate speech/imagery
SELF_HARM = "SELF_HARM" # Self-harm promotion
ILLEGAL_ACTIVITY = "ILLEGAL_ACTIVITY" # Illegal activities
OTHER = "OTHER" # Other policy violations{
"event_id": "019478a1-b2c3-7def-8901-234567890abc",
"event_type": "GEN_DENY",
"timestamp": "2026-01-28T14:23:45.123456Z",
"prompt_hash": "sha256:a1b2c3d4e5f6...",
"user_context_hash": "sha256:f6e5d4c3b2a1...",
"session_id": "sess_abc123",
"risk_category": "NCII_RISK",
"risk_score": 0.94,
"policy_version": "v2.3.1",
"model_id": "image-gen-v3",
"previous_hash": "sha256:9876543210...",
"signature": "ed25519:MEUCIQDx..."
}User Request
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β CAP-SRP SIDECAR β
β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β Step 1: Log GEN_ATTEMPT β β
β β (Commitment Point - BEFORE evaluation) β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β β
β βΌ β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β Step 2: Safety Evaluation β β
β β βββ SAFE βββββΊ Log GEN (output_hash) β β
β β βββ UNSAFE βββΊ Log GEN_DENY (risk_info) β β
β β βββ ERROR ββββΊ Log GEN_ERROR (error_info) β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β β
β βΌ β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β Step 3: Chain Linking β β
β β current_hash = SHA256(event + prev_hash) β β
β β signature = Ed25519.sign(current_hash) β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β β
β βΌ β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β Step 4: Merkle Tree Update (periodic) β β
β β β’ Compute new Merkle root β β
β β β’ Anchor to external TSA (RFC 3161) β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
The Completeness Invariant is the mathematical guarantee that no events have been added, removed, or modified:
For any time window [tβ, tβ]:
COUNT(GEN_ATTEMPT) = COUNT(GEN) + COUNT(GEN_DENY) + COUNT(GEN_ERROR)
- No Hidden Generations: Every
GENmust have a correspondingGEN_ATTEMPT - No Hidden Approvals: Can't add fake "approvals" without the attempt record
- No Deleted Denials: Can't remove denial records without breaking the equation
- Fraud Detection: Any manipulation breaks the invariant
from cap_srp.core.verifier import CompletenessVerifier
verifier = CompletenessVerifier()
result = verifier.verify(events)
if result.is_valid:
print(f"β
Completeness verified: {result.total_attempts} events")
else:
print(f"β Completeness violation detected!")
print(f" Expected: {result.expected_count}")
print(f" Actual: {result.actual_count}")
print(f" Missing: {result.missing_events}")βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β REFUSAL PROVENANCE DASHBOARD β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β
β System: ImageGenAI-v3.2 Status: β
COMPLIANT β
β Provider: Example Corp Last Event: 2026-01-28 14:23:45 β
β β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β
β COMPLETENESS VERIFICATION β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β
β Total Attempts: 1,247,893 [ββββββββββββββββββββ] 100% β
β βββ Generated: 823,456 [ββββββββββββββββββββ] 66% β
β βββ Denied: 419,234 [ββββββββββββββββββββ] 34% β
β βββ Errors: 5,203 [ββββββββββββββββββββ] <1% β
β β
β Invariant Status: β
VERIFIED (Ξ£ = 1,247,893) β
β Hash Chain: β
INTACT (2,847 blocks verified) β
β External Anchor: β
TSA + 3 Witnesses β
β β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β DENIAL BREAKDOWN BY RISK CATEGORY β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β
β NCII_RISK [βββββββββββββββββββ] 187,234 45% β
β CSAM_RISK [βββββββββββββββββββ] 92,108 22% β
β REAL_PERSON_DEEPFAKE [βββββββββββββββββββ] 71,456 17% β
β VIOLENCE_GRAPHIC [βββββββββββββββββββ] 43,234 10% β
β OTHER [βββββββββββββββββββ] 25,202 6% β
β β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
| Requirement | CAP-SRP Implementation |
|---|---|
| Automatic event recording | All events logged automatically via sidecar |
| Risk situation identification | risk_category + risk_score fields |
| Post-market monitoring | Continuous event stream + periodic reports |
| Deployer monitoring | Dashboard + API access for oversight |
| Tamper-evident storage | Hash chain + Ed25519 signatures |
| 6+ month retention | External TSA anchoring for long-term proof |
| Requirement | CAP-SRP Implementation |
|---|---|
| Systemic risk assessment | Denial pattern analysis + anomaly detection |
| Content moderation transparency | Public denial statistics (aggregated) |
| Audit access | Merkle proof export for independent verification |
| Documentation for enforcement | One-click regulatory report generation |
| Requirement | CAP-SRP Implementation |
|---|---|
| AI-generated content disclosure | output_hash + C2PA integration ready |
| Safety measure documentation | policy_version + denial reasoning |
| Audit trail maintenance | Complete event history with proofs |
# Run all tests
pytest tests/ -v
# Run with coverage
pytest tests/ --cov=cap_srp --cov-report=html
# Run specific test file
pytest tests/test_completeness.py -vcap-srp-dashboard/
βββ README.md # This file
βββ LICENSE # Apache 2.0 License
βββ requirements.txt # Python dependencies
βββ setup.py # Package installation
βββ pyproject.toml # Modern Python packaging
βββ .gitignore # Git ignore rules
β
βββ cap_srp/ # Main package
β βββ __init__.py
β βββ core/ # Core functionality
β β βββ __init__.py
β β βββ events.py # Event type definitions
β β βββ logger.py # Event logging with signatures
β β βββ signer.py # Ed25519 cryptographic signing
β β βββ merkle.py # Merkle tree implementation
β β βββ verifier.py # Completeness verification
β β
β βββ dashboard/ # Web dashboard
β β βββ __init__.py
β β βββ app.py # Streamlit dashboard
β β
β βββ utils/ # Utilities
β βββ __init__.py
β βββ helpers.py # Helper functions
β
βββ tests/ # Test suite
β βββ __init__.py
β βββ test_events.py
β βββ test_logger.py
β βββ test_merkle.py
β βββ test_verifier.py
β
βββ examples/ # Example scripts
β βββ demo_generate_events.py
β βββ demo_verify_completeness.py
β
βββ docs/ # Documentation
β βββ ARCHITECTURE.md
β βββ API.md
β βββ REGULATORY_MAPPING.md
β
βββ data/ # Sample data
βββ .gitkeep
- VCP Specification: VeritasChain Protocol for algorithmic trading
- IETF SCITT: Supply Chain Integrity, Transparency and Trust
- C2PA: Coalition for Content Provenance and Authenticity
- IETF draft-kamimura-scitt-vcp: VCP as SCITT Profile
- RFC 6962: Certificate Transparency (Merkle tree inspiration)
- RFC 3161: Time-Stamp Protocol (external anchoring)
- ISO/IEC 24970:2025: AI System Logging (complementary standard)
We welcome contributions! Please see CONTRIBUTING.md for guidelines.
# Clone with SSH
git clone git@github.com:veritaschain/cap-srp-dashboard.git
# Install development dependencies
pip install -e ".[dev]"
# Run pre-commit hooks
pre-commit installThis project is licensed under the Apache License 2.0 - see the LICENSE file for details.
- Organization: VeritasChain Standards Organization (VSO)
- Email: info@veritaschain.org
- Website: https://veritaschain.org
- IETF Draft: https://datatracker.ietf.org/doc/draft-kamimura-scitt-vcp/
This project builds upon:
- The IETF SCITT Working Group's foundational work on supply chain transparency
- Certificate Transparency (RFC 6962) concepts
- The broader AI safety and accountability community
"Verify, Don't Trust" β VeritasChain Standards Organization