Python SDK
Verify evidence offline
Verify a signed EVE evidence record independently and offline — in Python, Node, or the browser — without trusting the EVE server. Verification confirms the evidence is authentic and unaltered; it does not attest that the underlying decision was correct.
Prerequisites
- A signed evidence envelope from EVE (a decision, scan, MCP execution, monitoring, shadow, or red-team record).
- The ECDSA P-384 public key for independent (asymmetric) verification. An HMAC fallback is symmetric and not independently verifiable.
- Python, or Node 18+ (ESM) for the TypeScript/browser verifier.
Installation
Python: the embedded facade exposes verify_evidence. TypeScript/browser: install the client and use verifyDecisionCertificate.
pip install eve-coreguard # Python: verify_evidence
npm install eve-ai-governance # TS/browser: verifyDecisionCertificate
Runnable code
Python:
from core.eve_sdk import verify_evidence
result = verify_evidence("decision", certificate, expected_tenant="acme")
print(result["valid"], result["reason"])
TypeScript / browser (verifier holds no secrets and never signs):
import { verifyDecisionCertificate } from "eve-ai-governance";
const result = await verifyDecisionCertificate(envelope); // offline; public key only, no network
console.log(result.valid); // true when authentic and unaltered
Expected result
- A genuine, unaltered envelope returns
valid: truewithsignature: "kms-ecdsa-p384-valid"(production config). - The same Python-signed
jcs-1envelope verifies in TypeScript and in the browser — cross-language parity for the supported value domain.
Evidence output
envelope{content_hash, signature: "kms-ecdsa-p384-...", canon: "jcs-1"}
verifyDecisionCertificate(env) -> {valid: true}
Verification
Tamper detection is the point: change any signed field and re-verify.
const tampered = { ...envelope, decision: { ...envelope.decision, action: "ALLOW" } };
console.log((await verifyDecisionCertificate(tampered)).valid); // false — tamper rejected
Failure example
Verifying with the wrong public key, or an envelope whose bytes were altered, returns valid: false. An artifact scan envelope whose artifact_digest was changed is rejected, which is how substituted artifacts are caught after approval.
Production considerations
- Distribute and pin the ECDSA P-384 public key out of band; independent verification depends on it.
- Use the browser/Node verifier in environments that must not trust the EVE server — it holds no secrets and never signs.
- Verification proves authenticity and integrity, not decision correctness; keep that distinction in audit language.
Limitations
- Offline verification is SUPPORTED. It verifies integrity, signature, and schema — it does not attest the correctness of the underlying decision, only that the evidence is authentic and unaltered.
- Independent (asymmetric) verification requires the ECDSA P-384 public key; the HMAC fallback is symmetric and not independently verifiable.
jcs-1is a constrained RFC 8785 profile: it does not serialize non-integer floats / NaN / Infinity (fail-closed). Signed governance artifacts stay inside the supported domain (rates carried as integer permille).
Next step
Return to any subsystem guide — govern-a-tool-call.md, scan-an-artifact.md, test-a-shadow-policy.md — and verify the evidence it produces.