Skip to main content

ForgeSight audit trail — a tamper-evident, hash-chained, complete-capture projection of agent telemetry with a compliance query/export surface.

Project description

forgesight-audit

A tamper-evident, complete-capture audit trail for ForgeSight — a governance-grade projection of the telemetry the SDK already emits (feat-023).

It adds the three things ordinary telemetry lacks:

  • Integrity — every AuditEvent is hash-chained (prev_hash/hash); verify() walks the chain so deletion, alteration, or reordering is detectable.
  • Complete capture — it rides the event bus, so it records every run even when the trace was head-sampled out of the exporters.
  • A compliance query/export surface — query by principal / team / kind / time, roll up cost, and export an auditor bundle (JSONL + a manifest carrying the head hash).
import forgesight
from forgesight_audit import AuditListener, JsonlAuditSink, AuditQuery, verify

sink = JsonlAuditSink("audit/agent-audit.jsonl")
forgesight.configure(sample_rate=0.1, listeners=[AuditListener(sink)])  # 10% traces, 100% audit

# ... run agents as usual; audit events are recorded at source ...

assert verify(sink).intact                       # prove the log wasn't altered
report = sink.query(AuditQuery(principal="clinician-bot"))
print(report.event_count, report.cost_usd_total)
sink.export(AuditQuery(), to="audit/full.bundle") # JSONL + .manifest.json(head_hash)

Drivers: jsonl (default), sqlite, otel (emit as OTel log records), siem (JSON lines to a syslog/collector). Wire it as a listener (above), via configure(listeners=["audit"]), or forgesight_audit.install({...}) after configure().

It records — it does not enforce. Policy/budget enforcement is forgesight-governance. Apache-2.0.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

forgesight_audit-0.1.1.tar.gz (16.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

forgesight_audit-0.1.1-py3-none-any.whl (19.6 kB view details)

Uploaded Python 3

File details

Details for the file forgesight_audit-0.1.1.tar.gz.

File metadata

  • Download URL: forgesight_audit-0.1.1.tar.gz
  • Upload date:
  • Size: 16.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for forgesight_audit-0.1.1.tar.gz
Algorithm Hash digest
SHA256 8962b3e6eff84a45a3d09ecd4863973629e9dd1a5e556f42ab512e733182ec80
MD5 8b52694760861219fa97de89c116a46c
BLAKE2b-256 0352864dcb31c9df2819797652d34f64c37a9010e980c59f4ede84229db0582a

See more details on using hashes here.

File details

Details for the file forgesight_audit-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for forgesight_audit-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5936bbe6a774b71be1e924a6a2f010f71605f90e841091fdc3ed023eaf78f3df
MD5 86e390036e2a53e2ecaac1287bec3b78
BLAKE2b-256 ee792b72159e43123729eadf57bca5eb9831281dc6d1fc1827106e116d84e286

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page