Skip to content

bastiontrace 0.5.0: multi-agent forensics + OTel import

Choose a tag to compare

@Rinkia Rinkia released this 30 Sep 08:19
· 7 commits to master since this release
d8b4fbb

Multi-agent forensics — schema v2 → v3 (additive) — and an OpenTelemetry import.

  • Schema v3. An optional agent field on every event. A new agent_message
    event (from_agent, to_agent, kind, derived_from): content one agent handed
    another, both an inject site and a propagation edge. A header provenance
    (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, hops and replicated
    (the worm signal: the injection re-sent by 2 or more agents, explicit provenance
    only). The human output gains a cascade: 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 never linked);
    • system parts are skipped;
    • --forbid / --canary supply the policy;
    • a stderr warning and content_captured: false when the export has no content;
    • 200k-span cap, cycle-safe, malformed spans skipped.
  • Stricter reads. Provenance edges must point to an earlier seq. A header
    v newer 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). analyze takes exactly one of
    trace files, --otel or --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/bytesValue attributes and non-content
        message parts are read, not dropped;
      • unnamed agents stay distinct.
    • Analysis:
      • replicated counts 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 provenance is rejected;
      • a loaded v:1 header is written back as v:1.
  • Next: bastionprobe multi-agent attack scenarios that emit v3 traces; OTel
    sample apps with content capture; per-agent drift baselines (deferred).