Repository navigation
Labels
enhancementNew feature or requestobservabilityTracing, metrics, OTLPsecuritysecurity & trustv2.0Planned for v2.0 release
Milestone
Description
Summary
Every LLM call, tool invocation, retrieval, and agent decision is captured into a tamper-evident, cryptographically signed trace. Traces are exportable as portable audit bundles consumable by compliance teams, regulators, or external verifiers.
Motivation
Regulated industries (finance, healthcare, public sector) cannot deploy LLM agents without an auditable trail. Today this is glued together per-customer. A first-class verifiable trace makes SynapseKit the only framework enterprise compliance teams will approve.
This is also the foundation for trustworthy SelfImprovingAgent (#self-evolving) — every config change is signed and reproducible.
Design Sketch
from synapsekit import VerifiableAgent, AuditSink, SigningPolicy
agent = VerifiableAgent(
inner=my_agent,
signer=SigningPolicy.ed25519(key_path="./signing.key"),
sink=AuditSink.append_only("./audit.log"), # or .s3(...), .otel(...)
capture=["llm_calls", "tool_calls", "retrievals", "decisions", "state"],
redact=["emails", "ssn", "credit_card"],
)
result = await agent.run("...")
# Export tamper-evident bundle
bundle = agent.export_audit_bundle(run_id=result.run_id)
# bundle.zip contains: trace.jsonl, hashes.merkle, signatures.json, manifest.json
# External verification
from synapsekit.audit import verify
verify("./bundle.zip", public_key="./signing.pub")
# -> VerificationResult(valid=True, chain_intact=True, signed_at=...)Trace Format
- Append-only JSON Lines
- Each record:
{step_id, parent_id, kind, payload, timestamp, prev_hash, hash} - Merkle tree over
hashfield → root signed at flush - Compatible with OpenTelemetry spans (export via OTLP)
- Schema versioned
Components
-
VerifiableAgentwrapper -
AuditSinkinterface — file, S3, OTEL, Kafka -
SigningPolicy— Ed25519 default, KMS-backed option - Merkle hasher with deterministic serialization
- PII redactor (pluggable, regex + ML)
- CLI:
synapsekit audit verify <bundle.zip> - CLI:
synapsekit audit replay <bundle.zip>— re-runs trace, verifies same inputs, tool results, retrieval refs, and policy hashes (identical output is an optional deterministic-mode check only) - Selective disclosure: zero-knowledge style export of subsets of a trace
- Integration with
PrometheusMetrics— emitsaudit_records_signed_total
Use Cases
- GDPR / HIPAA / SOC2 audit evidence
- AI Act (EU) Article 12 logging compliance
- Court-admissible AI decision records
- Bug reproduction with full provenance
- Anti-prompt-injection forensics
Risks
- Performance — signing every record is expensive. Mitigate with batched Merkle signing.
- Key management — bring-your-own-key, HSM/KMS support from day one
- Privacy vs auditability — redaction must happen before hashing; document the tradeoff
Acceptance Criteria
- External tool can verify a bundle without SynapseKit installed (spec is open)
- Tamper detection: modify any byte in a trace → verification fails
- Replay verifies same inputs, tool results, retrieval refs, and policy hashes — identical output is an optional check for deterministic agents only
- OTEL exporter ships traces to Jaeger/Honeycomb
- Compliance whitepaper drafted (HIPAA + GDPR + EU AI Act mapping)
Bundle Verifier — Required Negative Tests
- One JSONL record removed from the middle of the chain
- Two records reordered
-
parent_idpoints to a record outside the bundle - Payload bytes changed after signing
- Merkle root valid but manifest schema version mismatched
- Key rotation between flushes
- OTEL export missing a record that exists in the signed bundle
Related
- Extends
PrometheusMetricsobservability (feat: OTEL-native observability metrics + helm chart #712) - Required infra for trustworthy
SelfImprovingAgent(#self-evolving)
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestobservabilityTracing, metrics, OTLPsecuritysecurity & trustv2.0Planned for v2.0 release
Activity
HarperZ9 commentedon Jun 28, 2026
This is a strong direction. The invariant I would make explicit early is that the audit bundle should prove both event integrity and redaction integrity.
One trap with "redaction before hashing" is that an external verifier can prove the redacted payload was not changed, but cannot tell whether the redaction policy was applied consistently unless the bundle also records the policy/version and the redaction outcome. I would make each event carry something like:
{ "event_id": "evt_123", "parent_id": "evt_122", "kind": "tool_call", "actor": "agent|tool|user|system", "payload_hash": "sha256:...", "redaction_policy_hash": "sha256:...", "redaction_status": "none|redacted|withheld", "schema_version": "trace-event/v1", "prev_hash": "sha256:...", "hash": "sha256:..." }That lets the verifier distinguish:
I would also be careful with "replay produces identical outputs" as an acceptance criterion. That is good for deterministic agents, but for LLM-backed agents the stronger general contract is probably: replay verifies the same admitted inputs, tool results, retrieval refs, state refs, policy hashes, and final claims. Identical output can be an optional deterministic-mode check rather than the baseline promise.
Useful negative tests for the bundle verifier:
I am building Project Telos around local-first receipt loops for agent actions, and the practical lesson has been that "signed trace" is only half the product. The other half is an honest verdict surface: MATCH when the bundle supports the claim, DRIFT when it contradicts it, and UNVERIFIABLE when the evidence needed to verify the claim was not admitted.
Abhay-Mmmm commentedon Jul 1, 2026
@AmitoVrito I can start working on this.
AmitoVrito commentedon Jul 1, 2026
Hey @HarperZ9 really appreciate you taking the time to dig into this so thoroughly!
Your point on the replay criterion is spot on and honestly something we would have gotten wrong. We're updating the acceptance criteria to verify same inputs, tool results, retrieval refs, and policy hashes rather than identical output — that's the right contract for non-deterministic LLM agents.
The negative test cases are gold, adding them directly to the issue.
On the redaction_policy_hash + redaction_status model -> you're absolutely right in principle, and the schema you've outlined is really well thought out. For v2.0 we're keeping the core feature focused on developer-facing audit trails (debug, replay, transparency), but we're treating your redaction consistency model as the blueprint for a compliance extension in a future release. It's exactly the right direction for regulated use cases.
Also curious about Project Telos sounds like you're solving a closely related problem. Would love to have you involved as a contributor if you're open to it! Also i would like to shave a look how is that going (soon !!)
Thanks again, this kind of review is exactly what makes the design better.
HarperZ9 commentedon Jul 2, 2026
Happy to stay involved. The split you described makes sense: keep v2.0 focused on developer-facing audit/replay first, but leave enough structure that the compliance extension can attach later without changing the core event model.
The first slice I would keep very small:
event_id,parent_id,kind,actor,payload_hash,schema_version,prev_hash,hash, plus optional/reserved redaction fields even if v2.0 does not enforce them yet.MATCH,DRIFT, orUNVERIFIABLE, not just true/false. That distinction matters when evidence is missing rather than contradictory.I can review the initial schema/fixture PR when it exists, or pressure-test a fixture against the receipt model I am using in Project Telos. The main lesson from that work is that the product is not just "a signed log"; it is the verifier that tells a developer which claims the log can actually support.
AmitoVrito commentedon Jul 14, 2026
Verifiable agents merged, thanks Abhay. The RFC 6962 Merkle work and the standalone verifier are the standout pieces here.