# Copilot's agent opened a pull request and pushed commits in one of our repositories. Where can we see exactly what it did and who started it, how long is that kept, and can we hand the session log to an auditor as our record?

**Short answer:** Start from the commit. Copilot cloud agent (called Copilot coding agent in GitHub's March 20, 2026 changelog) authors its commits as Copilot, lists the person who started the task as co-author, signs them so they show as Verified, and adds an Agent-Logs-Url trailer linking to the session log. The session log shows the agent's reasoning, the tools it used and the checks it ran. Enterprise owners can see sessions from the last 24 hours under AI controls, and filter the enterprise audit log with actor:Copilot to see agent activity for 180 days, with fields such as action, actor_is_agent, agent_session_id and the user who started it (pull_request.create carries the session ID). Neither one is a complete record you control: the audit log holds platform events, not the transcript, and only for 180 days unless you stream it out; the session log is GitHub's view of the run, and some session types can be deleted by the person who ran them. For an auditor, stream the audit log to your own storage, and keep the commit SHA, session ID and log link for each merged change in a record outside the repository.

## Checklist
1. For any agent commit, read the trailers: Copilot as author, the person who started the task as co-author, and Agent-Logs-Url pointing to the session log.
2. In the enterprise audit log, filter actor:Copilot and match agent_session_id across events to tie a pull request to the session that created it.
3. Set up audit log streaming (Amazon S3, Azure, Datadog, Google Cloud Storage, Splunk and others) if you need agent events older than 180 days.
4. Know which sessions can disappear: cloud sessions that run on GitHub Actions can be archived but not deleted, while synced CLI or app sessions and sandbox sessions can be deleted by their owner.
5. If you need prompts, responses and tool calls outside GitHub, look at Copilot usage record streaming or OpenTelemetry capture classes — both are opt-in and can carry source code, so send them only to an approved collector.
6. For each merged agent change, keep the merge commit SHA, agent_session_id, Agent-Logs-Url and reviewer in a record you control.

## Where can you see what GitHub Copilot's cloud agent did?
- Commits. GitHub's docs say commits from Copilot cloud agent are authored by Copilot with the person who started the task as co-author, are signed and show as Verified, and include a link to the session logs. GitHub's March 20, 2026 changelog names the trailer: Agent-Logs-Url, described as a permanent link from agent-authored commits back to the full session logs.
- Session log. Opening a session shows its log and overview: progress, token usage and session length, plus Copilot's reasoning and the tools it used to understand the repository, make changes and validate them, since the agent works in its own temporary environment where it can run tests and linters before pushing.
- Agent sessions view. Enterprise owners see the three most recent sessions under AI controls, and all sessions from the last 24 hours with View all, filterable by criteria.
- Audit log. Under AI controls, then Audit logs, enterprise owners can review agent activity across the platform.

## What does the GitHub audit log record for Copilot agent activity?
- GitHub's reference for agent events says the actor:Copilot filter shows agentic activity over the last 180 days. The key fields are action (for example pull_request.create), actor_is_agent (always true for agent events), agent_session_id (present when the event came from an agent session) and user (the person who started it).
- The enterprise audit log event list includes actor_is_agent on events such as pull request creation, closing and conversion to draft; pull_request.create also carries agent_session_id, which is how you join a pull request to the session log.
- To keep events longer or search them alongside other systems, stream the audit log to Amazon S3, Azure Blob Storage, Azure Event Hubs, Datadog, Google Cloud Storage or Splunk; Microsoft Agent 365 and Microsoft Purview accept Copilot agent session events only.
- Copilot usage record streaming (public preview, only for enterprises on Enterprise Managed Users or GitHub Enterprise Cloud with data residency) sends request and response records with user ID, endpoint, a JSON body trimmed to 1 MB with a truncated flag, a timestamp and GitHub's request ID. It's turned on with the Copilot Usage Records Streaming policy; the Copilot Usage Records API policy enables the matching REST endpoint.

## Is a Copilot agent session log an audit trail?
- The session log is the best place to see why the agent made a change: what it read, what it ran and what it saw. But it's written and stored by GitHub, it shows what GitHub recorded about the run, and you can't check from the log alone that nothing is missing.
- Retention depends on where the session ran. GitHub's session data page says cloud sessions on GitHub Actions are visible to anyone with access to the repository unless changed, and can be archived but not deleted. Sandbox sessions and synced Copilot CLI or Copilot app sessions are private to their owner unless shared, and can be deleted. Copilot CLI and the Copilot app keep the full local record under ~/.copilot/session-state/, which the user can also delete.
- Syncing local sessions to GitHub needs the Store local sessions in the Cloud policy for Copilot Business and Enterprise users, and GitHub says enabling syncing doesn't give administrators access to anyone's session data. So the session log is a working record for the person who ran the agent and for reviewers, not an organization-held audit trail.

## How do you keep your own record of Copilot agent changes?
- Stream the audit log out of GitHub before the 180-day window closes, so agent events (with actor_is_agent and agent_session_id) sit in storage your organization owns.
- If an investigation needs content, Copilot clients can export OpenTelemetry data to your collector. Every capture class is off until an administrator enables it; the identity class adds the Copilot account name, the local operating-system account and the machine name without prompts or responses. GitHub warns that the other classes can include source code, file contents, prompts, commands, tool results and MCP identifiers.
- At merge time, write down the merge commit SHA, the agent_session_id, the Agent-Logs-Url, who started the task and who approved the pull request, with a hash of the merged diff. That gives an auditor a fixed reference to compare against GitHub's records, even if a session is later archived or deleted.

## Ask Rightshold (free, no key)
Add the MCP server https://www.rightshold.com/mcp to Claude, Cursor, ChatGPT, Grok or VS Code (one-click setup: https://www.rightshold.com/start?ref=seo), then ask: "Copilot's cloud agent opened a pull request that we reviewed and merged. Record a receipt with the merge commit SHA, the agent_session_id, the Agent-Logs-Url, who started the task and who approved it by role, and the SHA-256 of the merged diff."

```json
{
  "tool": "record_action",
  "arguments": {
    "action_type": "agent.code_change_merged",
    "outcome": "success",
    "occurred_at": "2026-11-21T22:00:00Z",
    "client_event_id": "repo-billing:pr-1842:merge",
    "summary": "Copilot cloud agent PR 1842 merged as commit <merge sha>; agent_session_id <id from audit log>; Agent-Logs-Url <link from commit trailer>; task started by role backend engineer; approved by role code owner after review; CI checks green",
    "action_sha256": "<sha256 of the merged diff>"
  }
}
```
- Needs an API key. Send hashes, IDs and a summary; keep the diff and session log in your own systems.
- Use one client_event_id per merge, so a retry doesn't create a second entry.
- Anyone you share the receipt with can check it against the commit and diff without an account.
- A receipt records what you submitted and when. Rightshold doesn't read GitHub audit logs or session logs and doesn't confirm what the agent did.

_Rightshold isn't affiliated with GitHub or Microsoft. Details are from GitHub Docs pages on agent audit log events, monitoring agentic activity, managing agent sessions, Copilot session data, audit log streaming and the enterprise audit log event list, and GitHub's March 20, 2026 changelog, all read November 21, 2026. Features marked public preview can change, and availability depends on your Copilot plan and enterprise type._

## Sources
- [GitHub Docs: Audit log events for agents](https://docs.github.com/en/copilot/reference/enterprise-administrators/agentic-audit-log-events)
- [GitHub Docs: Monitoring agentic activity in your enterprise](https://docs.github.com/en/copilot/how-tos/administer-copilot/manage-for-enterprise/manage-agents/monitor-agentic-activity)
- [GitHub Docs: Managing agent sessions](https://docs.github.com/en/copilot/how-tos/copilot-on-github/use-copilot-agents/manage-and-track-agents)
- [GitHub Docs: About GitHub Copilot session data](https://docs.github.com/en/copilot/concepts/security-governance-and-network-settings/session-data)
- [GitHub Docs: Streaming the audit log for your enterprise](https://docs.github.com/en/enterprise-cloud@latest/admin/monitoring-activity-in-your-enterprise/reviewing-audit-logs-for-your-enterprise/streaming-the-audit-log-for-your-enterprise)
- [GitHub Docs: Audit log events for your enterprise](https://docs.github.com/en/enterprise-cloud@latest/admin/monitoring-activity-in-your-enterprise/reviewing-audit-logs-for-your-enterprise/audit-log-events-for-your-enterprise)
- [GitHub Changelog: Trace any Copilot coding agent commit to its session logs (March 20, 2026)](https://github.blog/changelog/2026-03-20-trace-any-copilot-coding-agent-commit-to-its-session-logs/)

## Related
- [Logging every AI agent tool call for audit](https://www.rightshold.com/answers/how-to-log-every-ai-agent-tool-call-for-audit)
- [Audit trail of which human authorized an AI agent action](https://www.rightshold.com/answers/how-to-audit-which-human-authorized-an-ai-agent-action)
- [Is an LLM observability trace the same as an audit trail of AI answers?](https://www.rightshold.com/answers/is-an-llm-observability-trace-the-same-as-an-audit-trail-of-ai-answers)
- [Make an AI agent's audit log append-only so even an admin can't silently delete entries](https://www.rightshold.com/answers/how-to-make-an-ai-agents-audit-log-append-only-so-even-an-admin-cant-silently-delete-entries)

_Not legal advice. Updated 2026-11-21. JSON: https://www.rightshold.com/answers/how-do-you-trace-what-github-copilots-cloud-agent-did-and-is-its-session-log-an-audit-trail.json_