feat(observability): export an atomic sandbox governance evidence bundle
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 8.7k
- Forks
- 1.3k
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 253
Description
Problem Statement
OpenShell already exposes the ingredients needed by external governance and compliance consumers: the effective sandbox policy, sandbox configuration and revision state, and OCSF audit events. Those ingredients are currently retrieved independently, however, so a consumer cannot establish that they describe the same sandbox state or determine whether the event interval is complete.
This is complementary to #1922 (portable, durable sandbox log collection) and #2640 (trace/span correlation). Durable logs and correlation fields are valuable inputs, but they do not bind the exact effective policy, sandbox/workload identity, event bytes, and completeness state into one authoritative export.
External adapters can hash and sign bytes they receive, but they should not invent authoritative associations or claim completeness that OpenShell itself has not established.
Proposed Design
Add an atomic export command along these lines:
openshell sandbox evidence export <sandbox> --since <timestamp> --output <directory>
The export would contain:
manifest.jsoneffective-policy.yamlevents.ocsf.jsonl
manifest.json should include:
- evidence format version;
- immutable sandbox ID and display name;
- OpenShell version;
- configuration and effective-policy revision;
- SHA-256 digest of the exact
effective-policy.yamlbytes; - workload/image digest when available;
- capture start and end times in epoch milliseconds;
- an explicit
completeboolean and, when false, a machine-readable reason; - OCSF schema version and event count;
- SHA-256 digests of every exported file; and
- trace/span identifiers when available.
Required invariants:
effective-policy.yamlis the policy OpenShell actually enforced, not the originally submitted input.- Every exported OCSF event's
metadata.uididentifies the exported sandbox. - OCSF product metadata records the OpenShell version that produced the event.
complete: trueis emitted only when OpenShell can account for the entire requested interval. Rotation, truncation, gateway restart, or unavailable history must producecomplete: falsewith a reason.- File digests cover the exact exported bytes. Existing credential redaction guarantees remain in force.
- The export stays vendor-neutral. OpenShell should provide authoritative evidence, not implement TRACE-specific signing or conformance logic.
Acceptance tests should cover:
- allowed and denied events validating against the vendored OCSF schemas;
- successful verification of all manifest digests;
- rotation/truncation causing an explicitly incomplete export;
- policy changes producing a new revision and digest;
- rejection/detection of cross-sandbox file substitution; and
- a credential-canary scan proving exported files preserve redaction.
This primitive would support SIEM ingestion, incident response, audit archives, and third-party governance formats without coupling OpenShell to any one consumer.
Alternatives Considered
- Implement only #1922: durable portable logs solve retention and transport, but not policy/workload binding or an authoritative completeness assertion.
- Let external tools stitch existing commands together: consumers cannot prove the reads were atomic or authoritatively declare completeness.
- Persist the current gateway log buffer: it remains an event source without binding to exact policy/configuration state.
- Use OTLP alone: OTLP is useful for semantic telemetry export, but does not by itself define an exact-byte, revision-bound evidence bundle.
Agent Investigation
Investigation was performed against OpenShell v0.0.105 (0f8fad23c4712afc1d4a7b07a06d635b030e9521):
proto/sandbox.protoexposesGetSandboxConfigResponse.config_revision.proto/openshell.protoexposes sandbox policy status/revision APIs.- The CLI/docs expose
openshell policy get <name> --fulland JSON sandbox retrieval. - OCSF JSON export is available when
ocsf_json_enabledis enabled. crates/openshell-ocsfsupplies product identity and sandbox identity throughmetadata.uid.- A duplicate search found #1922 and #2640, but no proposal for an atomic policy/revision/event/completeness evidence export.
A released external consumer demonstrates the current integration boundary and the reason the authoritative association belongs in OpenShell:
- https://pypi.org/project/agentrust-trace-adapters/0.1.0/
- https://github.com/agentrust-io/integrations/tree/main/integrations/openshell
- https://github.com/agentrust-io/integrations/blob/main/integrations/openshell/upstream-evidence-export-proposal.md
Checklist
- I have reviewed existing issues and architecture documentation.
- This is a concrete design proposal rather than a feature wish list.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with proto/sandbox.proto, proto/openshell.proto, the policy and sandbox CLI paths, and crates/openshell-ocsf to map existing revisions, identities, and event export. Define the atomic export boundary and its manifest, then use the listed acceptance tests to verify digests, completeness failures, policy revisions, cross-sandbox substitution detection, OCSF validity, and credential redaction.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cli, observability-sre
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100