Skip to content

evidence: link tool requests, permission decisions and reported results by invocation ID #412

Done

Description

@blitzcrieg1

Problem

An analyst needs to distinguish a requested tool call, a permission decision and a harness-reported result, then link the observations to the same invocation. Session-level correlation and tool_called alone do not establish that relationship or independently prove execution.

Matthias raised this as the first priority in his review of Agentmetry's investigation evidence.

What the current code already does

Reviewed source at c723ec29ba83c18e7499ed1ff330b0a97b5267b8, not a new runtime validation:

  • Claude PostToolUse mapping already derives success or failure. Other adapters also handle some post-tool observations. The gap is not a complete absence of result handling.
  • These Claude observations retain session correlation, but not the harness's tool-use ID. Canonical external tool construction has no common invocation/result metadata contract.
  • The default host_id implementation returns the hostname. That is not an independently established EDR device identifier.

Bounded first increment

Design an additive lifecycle contract for one documented hook adapter first, then extend only where the source actually supplies the fields. Keep existing action fields and their meanings compatible with existing consumers.

  • Preserve the source invocation ID and distinguish request, permission decision and reported result observations. Scope joins by source, session and invocation. Retries or attempts must not silently overwrite one another.
  • Preserve available structured exit code, error classification and duration, with the observation source and measurement semantics. Missing fields stay unknown. Missing error information must not itself establish success. Do not capture response bodies or arbitrary error text by default.
  • Separate observed permission decisions from inferred ones. A pre-hook allow does not establish execution. A post-hook report does not establish independent verification or prove which person operated an account.
  • Leave a request with no matching result unresolved. Do not guess a match from tool name, input hash, nearest timestamp or session membership when a source ID is absent.

Acceptance criteria

  • Record the adapter, documented version, available source fields and gaps. Distinguish documentation review, synthetic payload tests and any real-session validation.
  • Synthetic request, permission and result observations retain the same source invocation ID through hook normalization, HTTP ingest and canonical storage.
  • Concurrent calls of the same tool, retries, duplicate observations, out-of-order arrival and an unmatched result cannot be silently joined to the wrong invocation.
  • Denied requests, explicit failures, missing results and results without status remain distinguishable. Unknown stays unknown.
  • Available structured result fields survive ingest. Unsupported fields remain absent. Duration provenance and units are documented.
  • The Tenzir mapping preserves the added context, with an example query that joins observations without promoting reported identity or outcome to independent fact. Coordinate consumer changes before shipping.
  • Existing events and downstream contracts remain compatible. Frozen detection files are untouched and the ruleset fingerprint is checked during implementation validation.
  • Validation uses private synthetic inputs in an isolated, unhooked environment. No model run, live trail test or public validation evidence is required by this issue.

Corroboration design checkpoint

Before expanding collection, specify which independent log source could join on each proposed key: stable installation or host identity, actual agent process identity, process start time and cwd. Include provenance, availability and privacy implications. A hook process PID is not automatically the agent PID, a local installation ID is not automatically an EDR device ID, and PID alone is reusable.

Treat raw cwd collection and any change to existing host_id semantics as separate reviewed decisions. This issue does not authorize new default capture, an EDR integration, a fleet feature or a dashboard expansion.

Related work and exclusions

This is a design and implementation backlog item, not a claim that these guarantees have been implemented or tested.

Activity

  1. blitzcrieg1 commented on Nov 11, 2026

    @blitzcrieg1
    OwnerAuthor

    Optional corroboration example: Hayabusa and Windows logs

    Proposal for the independent-log design checkpoint in #412. This is a concept and future validation plan, not an implemented or tested integration.

    Purpose

    For one Agentmetry tool invocation, show the request, permission decision and harness-reported result alongside a separately collected Windows observation. Make the matching basis inspectable. Windows process creation can corroborate that a process started; it does not establish which person intended an action, successful command completion or successful exfiltration.

    Keep Hayabusa external. Start with explicitly selected exported files and a proposed sidecar evidence manifest, without installing a collector, importing arbitrary logs into the live trail or adding a dashboard section.

    Source and availability

    Hayabusa's output profiles include timestamp, computer, channel, event ID and record ID, with some profiles retaining source EVTX references and additional event fields. These are output-profile capabilities, not a guarantee that a particular log contains agent process identity or a matching result.

    Its analysis documentation also cautions against treating the Windows Computer field as a reliable machine identifier. Preserve the acquisition-to-host association separately.

    Record the exact Hayabusa version/ref, rules revision, selected command, profile, filters and timezone during validation. Recheck their compatibility before execution. Retain the underlying Windows records: a filtered detection timeline is not a complete process inventory, and no detection does not establish no execution.

    Proposed evidence references

    • Agentmetry: source event IDs, source/adapter, session and invocation IDs, observation phase and provenance. Invocation and process linkage depend on the contract developed in evidence: link tool requests, permission decisions and reported results by invocation ID #412.
    • Windows: acquisition reference, original EVTX content digest, channel/provider and record ID, plus the relevant event fields when actually present. Record ID alone is not globally unique.
    • Correlation: the exact fields compared, explicit host-identity mapping, process identity or PID plus process start time when available, lineage where supported, and any clock uncertainty. A hook process must not be silently identified as the agent or its launched child.
    • Keep the original observation, Hayabusa interpretation and analyst correlation separate. A source-file digest binds bytes, not the truth of their contents or the identity of the account operator.

    If #412 cannot supply a defensible link to the observed process, stop at a documented gap. The first outcome can be "not yet correlatable". Do not manufacture a process GUID or infer a match from hostname, tool name, command similarity or nearest timestamp.

    Bounded future validation

    • Prerequisite: define and validate the source invocation and process provenance in evidence: link tool requests, permission decisions and reported results by invocation ID #412.
    • Use a disposable, isolated Windows lab with dummy identities and a harmless local action. Retain an explicit account of any actual process execution; authored payload fixtures alone are only parser/mapping evidence.
    • Write expected outcomes and their hash before running. Use an unhooked terminal, explicit settings, full argument and command capture off, private temporary data and dogfood/live-trail guards before and after. No model-driven run or production logs.
    • Positive case: establish one invocation-to-Windows-observation relationship using actual available keys. State exactly what it supports and what remains unknown.
    • Negative cases: unrelated process with the same command near the same time; reused PID with a different start time; ambiguous or mismatched host identity; missing process/link fields; duplicate source records.
    • Missing Windows logs, unmatched requests or absent results remain unresolved. Denial is not proof of no execution, and absent Hayabusa detections are not a clean bill of health.
    • A query or small private comparison report retains both source references and the matching rationale. No raw command, path or account capture is enabled to make the example work. If those are needed, record a separate privacy/design dependency.

    Scope and sequencing

    First produce the evidence contract and one bounded comparison. Decide whether an importer or investigation UI is justified only after that comparison is useful. No default capture changes, automatic alert promotion, new detection rule, bundled Hayabusa runtime or fleet feature. This proposal does not expand the initial #412 implementation scope.

    Read-only research used Hayabusa source ref 3a1767eace5f5dd06a75970a6b945de03eeee1d9. No runtime validation has been performed for this proposal. Future raw results remain private, with no public validation claims added automatically.

  2. blitzcrieg1 commented on Nov 26, 2026

    @blitzcrieg1
    OwnerAuthor

    Closing as addressed by #445 (shipped in 0.14.0): session tree events now link Claude requests and reported results by the native invocation ID within their source and session, with unlinked approvals and ambiguous results kept visible and a guard against same-hash approval collisions. See docs/claude-invocation-evidence.md and tests/test_session_tree.py. The Hayabusa/Windows-log corroboration in the last comment is a separate design idea; happy to track it as its own issue if you want it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions