Skip to content

Optional call audit log (metadata only) on nodes/routers #974

Backlog

Description

@fazerluga-creator

Problem

Operators running a multi-agent mesh currently have no record of tool calls: neither the node nor the router logs who called which service, when, and with what outcome. The only way to reconstruct daily agent traffic is to inspect each application mailbox/outbox by hand.

Payloads should NOT be logged (that is a deliberate privacy property). But call metadata is essential for operations: debugging failed hand-offs, capacity planning, and abuse investigation after a node is banned.

Proposal

Add an optional, operator-enabled audit log of call metadata at the node and/or router level, e.g.:

  • timestamp, caller peer ID (+ attested labels), provider peer ID, service, tool
  • outcome (ok / error class), latency, bytes in/out
  • explicitly no argument or result payloads

A local JSONL sink or the existing metrics endpoint would both work. Disabled by default.

Activity

  1. aojea commented on Nov 28, 2026

    @aojea
    Collaborator

    Two things already exist today, and for the rest we want to use OpenTelemetry rather than build a custom audit log sink:

    • Existing structured logs (--log-format=json): agentmesh-node already emits payload-free Audit Traceability (allow/deny, peer_id, target, protocol, user, role, labels, actor_node, method/path or mcp_tool) and Stream Accounting (peer_id, target, protocol, bytes_read, bytes_written) lines. Running with --log-format=json emits these as JSONL ready for standard log collectors.
    • Routers cannot audit P2P tool calls: Node-to-node streams are end-to-end encrypted, so routers only see relay connections and external /ingress/ traffic.
    • Per-call latency, outcomes, and cross-node correlation: Rather than adding a bespoke call-audit JSONL sink, standard OpenTelemetry instrumentation (W3C traceparent propagation over HTTP / MCP _meta plus OTel spans/metrics) is the right fit and feeds into existing observability backends. We are already tracking that in Observability: following one task across the mesh (user stories, follow-up to #478) #844 (and structured logging consistency in Convert all logs to structured logging for consistency #331).

    Closing / consolidating this into #844 makes sense unless there is a specific gap that OTel + --log-format=json would not cover — let us know what you think.

  2. roonakyadav commented on Nov 28, 2026

    @roonakyadav
    Contributor

    Thanks for the clarification. I inspected the existing structured logging implementation and #844.

    I understand that the preference is to avoid introducing another audit sink and instead build on the existing structured logs and OpenTelemetry.

    One distinction I wanted to clarify: PR #980 adds per-tool-call outcomes, latency, byte counts, and caller/provider attribution at the node and ingress boundaries. The existing logs cover authorization decisions and stream accounting, but don't currently provide the same per-call execution record.

    I also noticed that #844 proposes additional functionality around task-instance correlation and W3C trace context propagation, which my current PR does not implement.

    Would you prefer me to:

    1. Close feat: add optional metadata-only call audit logging #980 and work on the missing observability functionality directly under Observability: following one task across the mesh (user stories, follow-up to #478) #844, extending the existing logging and OTel architecture?

    2. Narrow feat: add optional metadata-only call audit logging #980 to address only the per-call metadata gap, reusing the existing logging infrastructure rather than introducing a separate JSONL sink?

    I want to align the implementation with the project's intended architecture before making further changes.

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