A field guide to AI agents operating in Slack, GitHub, and Linear — covering permission design, side effects, failure modes, and safe testin

Audit Logging Agent Actions in Slack and GitHub

How to log agent actions so each one can be traced to its authorization.

· 9 min read · Updated
Cover illustration for “Audit Logging Agent Actions in Slack and GitHub”
Agent Permission Design · October 19, 2026 · 9 min read · 1,925 words

An audit of agent actions in Slack and GitHub needs more than a record of whether an API call worked. Every action needs a traceable chain connecting the triggering user, the agent, the OAuth grant, and the deploying organization. Instrumenting that chain makes the action attributable, timestamped, and verifiable, so an investigation can establish not just what happened, but whether it was authorized.

Why standard logs fail when an agent acts across Slack and GitHub

Scalekit describes a Slack triage agent that writes a credential-containing issue to the wrong GitHub repository. The CISO asks whether the agent was authorized to access that repository. Engineering opens the logs and finds no token record, no authorization timestamp, and no Slack-to-GitHub chain. The logs contain the final API result and lack the evidence needed to explain the action.

That evidence is missing because the logging model assumes that one human takes the action. When an agent creates a GitHub issue in response to a Slack message, the person requesting the work is not necessarily the identity executing it or the owner of the credential used. The deploying organization supplies another boundary, defining whose resources and permissions are involved. A log that collapses these identities into the final API caller loses the distinctions an investigation needs.

Consequently, a successful request says nothing about whether the token had the right scopes or whether the user had consented to this type of action. Standard application logs can answer “Did the API call succeed?” while leaving unclear whether the agent was authorized to act.

The four-principal chain and what must appear in every audit entry

Diagram: The Four-Principal Chain Every Audit Entry Must Capture. Visualizes: Visualize the four-principal chain that must appear in every audit entry for an agent action spanning Slack and GitHub.

A complete audit trail gives each of the four principals a traceable identity in every entry. The triggering user is the human whose Slack message started the work, and that identity belongs in both the agent-side record and Slack’s event log. The agent process has a separate service account or workload identity. Scalekit specifies that this machine identity must appear in every audit entry separately from the OAuth token owner’s identity.

The entry must show whose OAuth token owner grant gave access and list all the scopes granted at call time. The deploying organization supplies the tenant context that bounds what the agent may do on whose behalf. Preserving the distinct roles these identities describe in the same action makes it possible to distinguish a user’s request from an agent’s execution and from the authority delegated through a credential.

Authorization also has a lifecycle that the record must preserve. Agents that keep running refresh OAuth tokens silently every few hours, so refresh logs must show whether the credential was valid when an action ran. Each authorization-granted event must carry a timestamp to the second, the full granted scope list, the connection ID, the IP address and user agent, and the specific connected OAuth provider account. The connection_id is the join key between that event and downstream actions. Without it, individually well-formed entries still cannot prove that an action followed from a particular authorization.

How Slack and GitHub each expose (and obscure) agent activity at the platform level

Slack exposes the part of the record closest to the user’s interaction. Slack’s MCP integration includes logging that lets administrators see what each AI assistant accessed and what actions it took on behalf of a user. Agents are treated as participants with their own permission structures. That visibility matters, but it does not capture the agent’s internal tool-call sequence, its intermediate reasoning steps, or a GitHub write prompted by a Slack message.

GitHub exposes a different part of the chain through agent session visibility. GitHub improved Copilot coding agent session visibility on March 19, 2026, then added commit-to-session tracing on March 20, 2026. The Agent-Logs-Url trailer in an agent-authored commit links back to the full session logs, including the files read, tools called, and tests run. This provides a route from a repository change to the agent activity behind it. It does not, by itself, establish the Slack user’s initiating request or the OAuth authorization that permitted a cross-platform action.

An event record that spans both platforms must carry the connection_id through both systems and keep the platform identifiers for the action. That record also needs rules for what sensitive data it can carry before it reaches the logging destination. The Jahny-Robles audit lab illustrates this with one audit event per query, shipped to Microsoft Sentinel with identifiers already redacted. Storing raw identifiers in the SIEM would turn the investigative system into a second PHI store.

What a structured audit entry must look like at each instrumentation point

A useful audit entry is a structured event whose fields answer accountability questions without requiring the investigator to reconstruct its context. The Nylas CLI audit schema provides a concrete example. It records eight fields, including timestamp, command, grant_id, invoker, source, request_id, status, and duration_ms. The timestamp uses ISO 8601 in UTC, while the command preserves the full command with sensitive values redacted. The grant identifies the account used, and the invoker identifies the user or system that ran the command.

The source distinguishes invocation through a terminal, Claude Code, GitHub Actions, or MCP. The request ID correlates the local entry with the Nylas API request, while status records success or error and duration records round-trip time. That distinction between invoker and source is essential because an identity alone does not explain how an action began. A human typing in a terminal and an agent invoking a command through MCP are different audit contexts even when they use the same account.

For Slack-to-GitHub work, this example needs the additional principal-chain context. The entry must carry the triggering Slack message or thread ID, the agent’s service identity, the connection_id, and the scope list active at call time, within the deploying organization’s tenant context. The request ID ties the entry to a server-side request, and the connection ID ties it to the original authorization.

Protection of the record starts before storage. Nylas redacts API keys, access tokens, and email bodies before writing an entry to disk, preserving command structure and metadata. Tamper evidence shows whether the stored record has changed. SHA-256 hash-chained logs make deletions or edits detectable through a broken chain, while signed JSON exports and RFC 3161 timestamping provide further ways to support verification. These properties protect the evidence already captured, but cannot supply a missing principal or authorization event.

Instrumenting the approval gate: when an agent action requires a human decision before it runs

For actions that touch sensitive resources, a human approval gate adds evidence before the action runs. Such actions include writing to a repository, posting to a public channel, and escalating permissions. The record can establish which proposed action was reviewed, which policy required review, and whether the decision preceded execution. A post-run flag cannot show that the steps happened in that order.

Tracyn’s AuditAgent architecture implements this boundary with a blocking approval gate. When the policy engine flags a tool call, the SDK calls a pre-run approval endpoint before running the wrapped function. It then blocks by polling until a human decides in Slack, with email as the fallback when Slack is not configured. The action does not execute until the approval resolves.

The ordering also protects consistency in the audit record. Tracyn’s events table is append-only, and the status field is written once, correctly, at completion. Seeking approval after the action runs would need another state machine to keep pending and resolved states in line, with a risk that they could fall out of sync. Capturing the approver’s identity, decision timestamp, triggering policy rule, and full flagged-call context at decision time avoids relying on later reconstruction. The Slack message provides separate corroboration by carrying the agent identity, proposed action, and approval decision in a human-readable channel record.

Testing the audit trail without touching live Slack or GitHub APIs

An audit design is not dependable until tests exercise the conditions that can break its chain. Tests need to cover token refresh during a session and multi-step tool calls that span Slack and GitHub. Testing only successful final requests leaves the intermediate evidence unexamined. Live APIs make that examination difficult because rate limits can interrupt the sequence and live credentials can create real issues or post real messages. With non-deterministic responses, tests also cannot reliably compare a known sequence of events with the audit entries expected for it.

Stateful simulation supplies the continuity that this test requires. Posting a message, triggering the agent, creating an issue, and labeling it must each update shared state. Channel history, repository state, and user identities that are set up in advance give the agent the same starting point on each run. That repeatability makes differences in the audit record meaningful. It allows the test to examine the whole chain rather than a collection of unrelated API responses.

ClawsBench’s Slack implementation in 2026 illustrates what a conformance-tested stateful mock can provide. It implements a substantial share of Slack Web API endpoints, carries 57 fixtures and documented conformance tests, and records known quirks. Its last production capture was on 2026-03-27. Those details establish a concrete basis for understanding the simulated platform’s coverage rather than assuming that a mock behaves like production in every case.

Fault injection extends that coverage to failures and retries. Deliberate 429s, latency spikes, and token-expiry responses test whether the audit log preserves the unsuccessful paths as accurately as successful ones. Silent degradation is harder to test because it corrupts the output but leaves latency and token counts unchanged. Cost and latency telemetry can still look normal when the result is wrong. Testing the audit trail against this condition requires a simulator that can inject it deliberately, rather than waiting for a live failure to expose the gap.

Mapping audit events to compliance frameworks and making them queryable

Once the chain is captured and tested, it must be searchable in the terms reviewers use. Filtering by principal, time window, scope, and action type turns stored events into evidence for a particular question. For SOC 2 review, the relevant mapping makes each agent action attributable to a specific OAuth grant and service identity, supported by the authorization-granted event.

Unexplained scope expansion without re-consent may violate GDPR Article 5(1)(b). An oauth_scope_change_approved event is a recommended implementation practice, and its timestamp can show that consent preceded expanded access. HIPAA §164.312(b) requires ways to record and examine what happens in systems that contain or use electronic protected health information. The Jahny-Robles lab explicitly maps PHI-submission detections to this provision, illustrating how an audit event can support a defined control.

Scalekit notes that enterprise security teams ask for an authorization-model walkthrough during procurement, making the audit trail a sales artifact as well as a security one. Nylas demonstrates the operational query pattern through filters for source, date range, command, status, grant, request ID, and invoker. Using those filters together narrows the record to one agent session or type of failure. Cross-platform instrumentation must make the added details about principals and authorization just as easy to find and use.

The definition of done is an evidence pack that cites specific log events in answer to specific questionnaire questions. Producing that artifact should not require manual reconstruction from disconnected systems. In the opening incident, the record would identify the initiating Slack user, the agent identity, the grant and scopes used, and the authorization timing behind the GitHub write. Any required approval would have its own attributable decision record. The CISO’s question could then be answered from the evidence, whether that evidence showed an authorized action or an authorization failure.

Sources

  1. Slack

More in Agent Permission Design