Repository navigation
bastiontrace 0.5.0: multi-agent forensics + OTel import
Multi-agent forensics — schema v2 → v3 (additive) — and an OpenTelemetry import.
- Schema v3. An optional
agentfield on every event. A newagent_message
event (from_agent,to_agent,kind,derived_from): content one agent handed
another, both an inject site and a propagation edge. A headerprovenance
(explicit|inferred). Traces without v3 features are still written as
v:2, byte-identical, so the bastionprobe contract golden is unchanged. - Cascade findings.
patient_zero,agents_reached,hopsandreplicated
(the worm signal: the injection re-sent by 2 or more agents, explicit provenance
only). The human output gains acascade:line. from_otel/analyze --otel FILE. OTel GenAI spans (OTLP/JSON or Collector
JSONL) become v3 traces:- events are ordered by span start/end, and provenance is inferred from the
span tree (so findings are neverlinked); - system parts are skipped;
--forbid/--canarysupply the policy;- a stderr warning and
content_captured: falsewhen the export has no content; - 200k-span cap, cycle-safe, malformed spans skipped.
- events are ordered by span start/end, and provenance is inferred from the
- Stricter reads. Provenance edges must point to an earlier seq. A header
vnewer than this reader, or an unknown event type, fails with an upgrade hint. - CLI.
--example cascade|session-smuggling|clean-multiagent|otel-cascade|exfil
runs bundled samples (now shipped in the wheel).analyzetakes exactly one of
trace files,--otelor--example. Bad input is one line on stderr with exit 2,
not a traceback. - Faster. Edges are indexed once and a combined pre-filter skips clean text.
A 200k-event trace analyzes in well under a second; the OTel import is linear. - Review fixes.
- OTel ordering:
- at equal timestamps, results and replies sort before new delegations;
- a span with a missing or backwards end time is stretched to its last descendant.
- OTel content:
- delegations carry the parent's whole context, not just its reads since the
last delegation; - JSON-shaped strings,
kvlistValue/bytesValueattributes and non-content
message parts are read, not dropped; - unnamed agents stay distinct.
- delegations carry the parent's whole context, not just its reads since the
- Analysis:
replicatedcounts only messages downstream of the injection;- a forbidden call that happened before the first located injection is
reported as a landing that is not attributed to it.
- Input handling:
- hostile field types in a trace are a one-line error (exit 2);
- an unknown header
provenanceis rejected; - a loaded
v:1header is written back asv:1.
- OTel ordering:
- Next: bastionprobe multi-agent attack scenarios that emit v3 traces; OTel
sample apps with content capture; per-agent drift baselines (deferred).