Skip to main content

Investigate agent activity with audit logs

Find, read, and investigate what Permit MCP Gateway did with each agent call. This page is for gateway admins who monitor agents, debug denied calls, or collect activity for a compliance review.

The gateway writes every agent call, every Permit check, every Guardian verdict, and every identity registration to the audit log of the Permit.io environment linked to the host. You don't add logging code.

Prerequisites​

  • An admin account on the admin dashboard (app.agent.security) with access to the host.
  • For the raw decision log: access to the Permit project and environment linked to the host in the Permit.io dashboard. Settings > Environment in the admin dashboard shows which project and environment the host uses.
  • At least one agent that completed the consent flow and called a tool.

Where audit logs live​

LocationWhat it showsUse it for
Dashboard > Live activityThe latest calls across the host, with an All and a Blocked view.Watching activity as it happens.
Agents > agent > Audit LogsEverything one agent did on one server.Following one agent.
Humans > person > Audit LogsEverything the person's agents did.Reviewing everything done on one person's behalf.
MCP Servers > server > Audit LogsEvery call to one server, from all agents and people.Reviewing a sensitive server.
Audit Log in the Permit.io dashboardThe raw decision log of the linked environment.Filtering by date, user, and decision, and exporting entries with the API.

Watch live activity on the Dashboard​

The Dashboard shows Gateway activity for the last 1 hour, 6 hours, 24 hours, or 7 days: governed calls, allowed and denied counts, calls the Guardian flagged, and approvals waiting. Top denied intents groups denials by what the Guardian graded each call against, and Top agents by denials lists the agents denied most.

The Live activity feed lists each call as it happens. Select Blocked to see only refused calls, and click the pause button to stop the feed while you read it.

Dashboard with gateway activity, Top denied intents, Top agents by denials, and the Live activity feed

Read the Audit Logs tab​

Each agent, person, and MCP server page has an Audit Logs tab. A key above the table names the four kinds of event:

  • Request: the agent's call: a tool, a read, a prompt, or a CLI / API call.
  • Policy check: Permit's decision for the agent or the person, or the trust ceiling.
  • Guardian: the AI judge's verdict on the call.
  • Identity check: the agent's Semantic Identity registration.

Audit Logs tab of Acme Research Agent with tool calls, Guardian verdicts, and their reasons

The table has five columns:

ColumnContents
WhenThe time and date of the event.
IdentityWho the event is about: an Agent (its client ID, shortened) or a Person (their subject, shortened).
EventThe tool, resource, or event name, with the kind of event under it.
DecisionAllowed or Denied.
ReasonWhy. For a request, which check decided it. For a Guardian verdict, the scores and reasoning.

Event types​

EventKindWhat it records
Tool callRequestOne agent tool call and how it ended. Allowed means the MCP server ran the tool.
Resource readRequestOne resources/read call.
PromptRequestOne prompts/get call.
CLI / API callRequestA request through the HTTP egress proxy.
Permit check on <server>Policy checkOne Permit check, for the agent or for the person.
Trust ceilingPolicy checkA tool refused because its trust level is above the level the person approved the agent at.
Guardian verdictGuardianThe Guardian's grade of one call.
Identity checkIdentity checkOne gateway_register_session registration, or a block.

Request reasons​

A request's reason has the form "Tool call on deepwiki: <reason>". The reasons are:

ReasonWhat it meansWhat to check
allowed by the agent and person checksPermit allowed the agent and the person, and the server ran the call. A server the person added by URL shows "allowed by the agent check".Nothing.
allowed by the agent and person checks and approved by an approverThe call waited for approval and was approved.Approvals > History for who decided.
refused: the agent has not registered its sessionThe host requires agent identity, and the agent had no current registration.Whether the agent calls gateway_register_session. See Check agent identity and intent.
denied by the agent checkThe agent's trust level on the server is below the tool's trust level.Show checks, then the agent's trust level.
denied by the person checkThe person's own access to the server doesn't cover the tool.Humans > person > MCP Server Access.
denied by the agent and person checksBoth checks denied.Both of the above.
denied: a permission check got no answer from the PDPPermit's policy decision point (PDP) didn't answer, so the gateway refused the call.The Permit environment linked to the host.
refused: the tool's trust level is above the trust level the agent was approved atThe trust ceiling refused the tool.The level the person approved the agent at, on Consent Grants.
denied by the guardianThe Guardian refused the call.The Guardian verdict row next to it.
rejected by an approverAn approver rejected the call.Approvals > History.
refused: no approver answered before the approval request timed outNobody decided within the timeout.Approval notifications.
cancelled while waiting for approvalThe client cancelled the call or disconnected while it waited.The MCP client.

Show the agent and person checks​

Tool call rows have Show checks. It expands into the two Permit checks behind the decision:

  • Agent check: Permit checked that this agent may use this tool on the server, at the trust level its person approved. Every call needs this check to allow it.
  • Person check: Permit checked that the person the agent acts for may use this tool themselves, at their own trust level. It stops an agent from using another person's approval. A server a person added by its URL has no person check.

Audit row with checks shown: Agent check Denied, Person check Allowed

Guardian verdict rows​

On a host with the Guardian on, each graded call has a Guardian verdict row next to its request row. The reason starts with the scores, for example alignment: 0.15, confidence: 0.85, risk: high, followed by the Guardian's reasoning:

  • An allowed call: alignment: 0.85, confidence: 0.90, risk: low, "Action reads public repository documentation to answer engineering questions about React, which directly serves the declared read-only research intent and stated task scope."
  • A denied call to acme-corp/payroll-service: alignment: 0.15, confidence: 0.85, risk: high, "Action targets a private internal repository (payroll-service) rather than public GitHub repositories for React/Next.js research as declared."

Click the arrow next to the tool name to see what the Guardian graded the call against: the server's intent, the person's task, or the agent's registered words. The expanded row also shows the second check, which grades the call against the agent's own task sentence and is recorded only. When the second check would have decided differently, the Decision column shows a note such as Second check would deny.

Identity check rows​

On a host with Require Agent Identity on, each registration writes an Identity check row. The event name says what happened:

Event nameWhat happened
Session RegisteredThe agent's first registration. The reason says the identity was established and the initial fingerprint created.
Identity RefreshedA later registration, accepted. The reason gives the drift from the earlier registration, for example drift 0.7%.
Drift WarningThe drift reached the Warn threshold. The registration was accepted.
Session BlockedThe gateway blocked the agent's MCP session, for example after the drift reached the Block threshold.
Blocked Session RefusedThe agent tried to register on a blocked session.
Drift BlockedThe agent drifted and was sent to the person for re-approval.
Re-approval RequiredThe agent was sent to the person for re-approval for another reason, such as three blocked sessions within 24 hours.
Task MismatchThe agent's task sentence didn't fit the task the person set.
Registration RefusedThe registration broke a rule, such as a missing task or too few known words.

Click the arrow on an identity row to see the words and task the agent sent, the question it answered, the outcome, and the MCP session.

Audit table with allowed and denied tool calls, Guardian verdicts, and a Session Registered row

Person and server tabs​

The person's Audit Logs tab shows the activity of every agent that acts for the person. The server's tab shows every call to the server, with the Permit check on rows for both the agent and the person.

Audit Logs tab of the DeepWiki server with a rejected call, a Guardian verdict, Permit checks, and an Identity Refreshed row

Partial view for people with many agents

The person and agent views query at most 50 agent registrations. When there are more, the tab shows a Partial audit view notice, and activity from the other registrations is missing. Use the Permit.io dashboard to see all entries.

View the raw decision log in Permit​

  1. Sign in to the Permit.io dashboard.
  2. Select the project and environment linked to your Permit MCP Gateway host.
  3. Open the Audit Log screen.
  4. Select an entry to open its decision log.

On the Audit Log screen, you can filter entries by user, date, decision, and tenant. For details, see View and filter audit logs.

Map an entry to the policy model​

For each call, the gateway asks Permit two questions about the same tool and server. The agent check runs on every server. The person check runs on servers an admin imported:

permit.check("agent|<client_id>|<subject>", "<tool_name>", "<server_key>:<server_key>")
permit.check("human|<subject>", "<tool_name>", "<server_key>:<server_key>")

For example, Acme Research Agent's call to ask_wiki_question on DeepWiki checks the user agent|<client_id>|<subject>, the action ask_wiki_question, and the resource deepwiki:deepwiki. Each agent is one person using one MCP client, so the agent key holds both the client ID and the person's subject. Permit derives the agent's role on the server from the lower of two trust levels: the level the person approved the agent at, and the person's own maximum trust level. See How Permit MCP Gateway works with Permit.io.

The gateway also writes its own row for each call, with the resource type gateway.<server_key> and the action gateway.mcp_tool_call (or gateway.mcp_resource_read, gateway.mcp_prompt_get). That row is the Tool call row of the admin dashboard. For Permit's denial codes, such as user_not_synced and no_such_resource, see Denial codes in decision logs.

Investigate common questions​

Why was a tool call denied?​

A user reports that Acme Research Agent can't call ask_wiki_question on DeepWiki.

  1. Go to Agents, open Acme Research Agent, and select the Audit Logs tab.
  2. Find the denied ask_wiki_question row. The reason reads "Tool call on deepwiki: denied by the agent check".
  3. Click Show checks. Agent check is Denied and Person check is Allowed: the person may use the tool, but the agent was approved at a lower trust level than the tool needs. In this example, ask_wiki_question is a Medium tool and the agent's badge on its page reads Low.
  4. Ask the person to revoke the agent on Your MCP agents, then reconnect it from the MCP client and pick Medium on the consent screen. Reconnecting while the grant is active doesn't show the consent screen. Admins can lower an agent's trust level but can't raise it.
  5. If the consent screen doesn't offer Medium, the person's own maximum is lower. Go to Humans, open the person, and raise the Trust level for DeepWiki in MCP Server Access first.

Result: the next ask_wiki_question call shows Allowed.

Why did the Guardian deny a call?​

  1. On the agent's Audit Logs tab, find the Guardian verdict row next to the denied call.
  2. Read the reasoning, and click the arrow to see what the Guardian graded against.
  3. If the call was legitimate, reword the server's intent and test the call with Dry Run. See Write a server intent.

Which person authorized an agent?​

  1. Go to Agents and open the agent. The header reads "On behalf of" the person's email, on the server.
  2. Go to Consent Grants to see the level, task, and end date the person approved.
  3. On Humans, open that person to see their server access and every agent that acts for them.

Result: each tool call traces back to one person: person, consent, agent, tool call.

Which calls reached a sensitive MCP server?​

For example, a compliance team reviews all agent calls to an MCP server connected to a production database.

  1. Go to MCP Servers and open the server.
  2. On the Audit Logs tab, review the Tool call rows. Allowed rows reached the server. Denied rows were stopped by the gateway, and the reason says which check stopped them.
  3. For each allowed call, open the agent to find the person who authorized it.
  4. To list only allowed or only denied calls over a period, use the Audit Log screen in the Permit.io dashboard and filter by decision.

How did an agent's access change over time?​

  1. Go to Consent Grants and click View all history. History lists each approval, change, pause, expiry, and revoke.
  2. On the agent's Audit Logs tab, compare older and newer entries for the same tool. A tool that was allowed and is later denied points to a lower trust level or an ended grant.

Collect activity for a reporting period​

  1. In the Permit.io dashboard, open the Audit Log screen for the environment linked to the host.
  2. Filter by the date range of the reporting period.
  3. To filter by resource or action, or to collect the entries in code, call the List audit logs endpoint.
  4. For a view per person, open the person on the Humans page of the admin dashboard. The Audit Logs tab shows activity from all of the person's agents.
Audit log retention

Permit deletes old audit logs periodically. For retention details, see View audit logs.

Next steps​