Skip to main content

Documentation Index

Fetch the complete documentation index at: https://cyberpaisa-dof-mesh-40-27.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

1. Install

pip install dof-sdk==0.8.0

2. Verify an Agent Output

from dof.quick import verify

result = verify(
    "## Analysis Report\n\n"
    "The DOF framework achieves 96.8% F1 score on adversarial benchmarks. "
    "The system processes requests in under 30 milliseconds.\n\n"
    "We recommend continued monitoring."
)
print(result)
# {"status": "pass", "violations": [], "layers": {"constitution": "pass",
#  "ast": "pass", "oracle": "pass"}, "latency_ms": 14.2}

3. Verify Generated Code

from dof.quick import verify_code

result = verify_code('API_KEY = "sk-abc123def456ghi789"')
print(result["passed"])     # False
print(result["violations"]) # ["PII/secret pattern detected"]

4. Run Z3 Formal Proofs

from dof.quick import prove

result = prove()
# {"verified": True, "theorems": [
#   {"name": "GCR_INVARIANT",   "result": "VERIFIED", "time_ms": 3.10},
#   {"name": "SS_FORMULA",      "result": "VERIFIED", "time_ms": 1.80},
#   {"name": "SS_MONOTONICITY", "result": "VERIFIED", "time_ms": 2.40},
#   {"name": "SS_BOUNDARIES",   "result": "VERIFIED", "time_ms": 1.20}
# ]}
From the CLI:
dof prove
# All verified: True | Total time: 8.6ms
#   VERIFIED  GCR_INVARIANT    (3.10ms)
#   VERIFIED  SS_FORMULA       (1.80ms)
#   VERIFIED  SS_MONOTONICITY  (2.40ms)
#   VERIFIED  SS_BOUNDARIES    (1.20ms)

5. Check System Health

dof health
# DOF v0.8.0 — 16/16 components available
{
  "version": "0.8.0",
  "total": 16,
  "available": 16,
  "components": {
    "ConstitutionEnforcer": "ok",
    "ASTVerifier": "ok",
    "DataOracle": "ok",
    "GovernedMemoryStore": "ok",
    "ExecutionDAG": "ok",
    "LoopGuard": "ok",
    "TokenTracker": "ok",
    "MerkleTree": "ok",
    "CertificateSigner": "ok",
    "OAGSIdentity": "ok",
    "GenericAdapter": "ok",
    "TestGenerator": "ok",
    "AgentLeakMapper": "ok",
    "Z3Verifier": "ok",
    "BayesianProviderSelector": "ok",
    "RuntimeObserver": "ok"
  }
}

6. Full Pipeline — Verify an Action

from dof import DOFVerifier

verifier = DOFVerifier()
result = verifier.verify_action(
    agent_id="my-agent-001",
    action="transfer",
    params={"amount": 500, "token": "USDC", "to": "0xabc..."}
)

print(result.verdict)      # "APPROVED"
print(result.z3_proof)     # "4/4 VERIFIED [GCR_INVARIANT:VERIFIED | ...]"
print(result.latency_ms)   # 8.2
print(result.proof_hash)   # "0x44b45cd026916c..."
The proof_hash is a keccak256 hash of the decision. With on-chain attestation enabled, it is recorded to DOFProofRegistry on your target chain.

CLI Cheatsheet

dof verify "<text>"          # Constitution + AST + DataOracle
dof verify-code <file>       # AST only
dof check-facts "<text>"     # DataOracle only
dof prove                    # Z3 formal proofs (4/4)
dof verify-states            # Z3 state invariants
dof verify-hierarchy         # Z3 hierarchy (42 patterns)
dof benchmark                # Adversarial benchmark
dof health                   # 16/16 components
dof version                  # v0.8.0
dof --json <command>         # JSON output

What Happened?

Input
  → Constitution        (HARD/SOFT rules, zero LLM)
  → AST Validator       (code block static analysis)
  → Tool Hook Gate PRE  (intercepts before execution)
  → Supervisor Engine   (cross-turn behavior scoring)
  → Adversarial Guard   (prompt injection detection)
  → Memory Layer        (reproducible session state)
  → Z3 SMT Verifier     (4/4 invariants formally proven)
  → Output + proof hash
No LLM decides if your agent broke a rule. A deterministic function does. Every time. Same answer.

7-Layer Governance

Deep dive into each layer

On-Chain Attestations

Write proof receipts to 9 chains

Running the Mesh

Launch the full multi-LLM mesh

CLI Reference

Complete CLI command reference