AI Agent Permissions for Incident Investigation

AI agent permissions for incident response: use read-only telemetry tools, scoped tokens, query limits, redaction, approval gates, and audit trails.

An isometric incident investigation console where an AI agent can query telemetry through a read-only gate while write actions stay locked behind approval

Contents

If you’re asking, “How do I let AI agents investigate incidents without giving them unrestricted production access?” the answer is: give the agent scoped read access to telemetry, not production access. It should read logs, traces, metrics, alerts, dashboards, service metadata, and change events through named tools. It should not get shell access, secret access, deploy access, or unrestricted cloud-console access for its default investigation workflow.

Treat the model prompt as instructions, not access control. The control has to live in the tool server, the agent runtime, the credential, and the audit trail.

A safe incident investigator usually needs five boundaries:

  • Read-only tools for evidence gathering.
  • Per-agent credentials you can rotate and revoke without breaking every developer session.
  • Query limits for time windows, result counts, retries, and tool-call budgets.
  • Payload controls so raw logs, spans, request bodies, and PII are not sent to the model by default.
  • Audit records that show what the agent could access, what it called, what it changed, and what it could not verify.

This guide is vendor-neutral in the policy shape. I use Last9 MCP examples because the docs are public and the controls are concrete.

Why production access is the wrong unit for an AI investigator

An incident investigator needs evidence. It does not need the same powers as an engineer holding a production break-glass role.

A human SRE can notice when a request asks for too much: “show me errors for checkout-api between 14:00 and 14:30 UTC” is different from “dump every customer request from production.” An agent will call whatever tools you expose if the model thinks they help. If the only available tool is a broad shell, database, or cloud API, the permission boundary becomes the model’s judgment.

That is the wrong layer for access control.

The safer unit is an investigation workflow. Define what the agent is allowed to inspect for one incident class, then expose only those tools. For a latency or error investigation, that usually means:

  • service summaries and available environments;
  • current and historical alerts;
  • exception groups;
  • logs from one service and bounded time window;
  • trace waterfalls and trace attribute comparisons;
  • metrics queries for known service or infrastructure signals;
  • dependency and change-event context.

It does not mean default access to kubectl exec, production databases, cloud IAM, secret stores, deploy systems, or alert and dashboard writes. Those actions belong in a separate remediation workflow.

This separation also makes the agent easier to evaluate. If it cannot change production, a bad run is usually an evidence-quality problem. If it can change production, a bad run becomes an incident inside the incident.

Start with a read-only tool boundary

For an investigation agent, read-only should be a server-side property where possible, not just a line in the system prompt.

In MCP, tools can advertise annotations such as readOnlyHint. Last9 MCP sets readOnlyHint on every tool. Read tools set it to true; write tools set it to false and also carry a destructiveHint. Clients can use those annotations to auto-run read tools and require confirmation for writes.

If you self-host Last9 MCP, the server can enforce a stronger boundary:

last9-mcp --read-only

or:

export LAST9_MCP_READ_ONLY=true
last9-mcp

That serves only tools marked readOnlyHint: true. It hides tools that create, change, delete, acknowledge, reassign, or mute production objects.

If a workflow needs one specific write, keep it named and explicit:

last9-mcp --read-only --allow-write-tools=patch_alert

That is a different policy from “the agent is probably safe.” It says: this workflow can read everything in its allowed toolsets, and the only write tool exposed is patch_alert.

Last9 MCP also has toolsets. For an investigation host, LAST9_TOOLSETS=investigate narrows the visible tools to investigation-oriented logs, traces, metrics, profiles, and discovery tools. Toolsets and read-only mode combine: a tool has to pass both filters.

For hosted or third-party MCP clients, use the same idea at the client layer. The OpenAI Responses API example in the Last9 docs allowlists only two read tools and skips approval only for those tools. That shape is safer than exposing every tool and trusting the model to choose well.

Scope credentials by agent, workflow, and environment

Do not give every agent the same token. Use one credential per bot, workflow, pipeline, or shared service. That lets you answer a basic incident question later: which identity did this run use?

A practical split looks like this:

IdentityUse it forDefault access
Human IDE sessionDeveloper asks questions from an editorOAuth sign-in, reviewed through the IDE client
On-call investigation botIncident thread asks for evidenceRead-only MCP token, one or a few toolsets
CI or release checkerPost-deploy checksRead-only metrics, logs, traces, and change impact tools
Remediation workflowApproved action after investigationSeparate token, named write tools, explicit approval

Last9’s docs separate these modes. Developers using an IDE can sign in through hosted OAuth. Agents, services, and CI pipelines use MCP client tokens created from Query Tokens with Token Type: Client and Client Type: MCP. Those tokens are sent as Authorization: Bearer <token> to the MCP endpoint.

Write tools need a token with write scope, and delete tools need delete scope. That matters because tool filtering and token scope should agree. A read-only investigation agent should not hold a token that can create alert rules, edit dashboards, or add drop rules.

Keep environment scope in your application too. A staging incident should not quietly trigger production queries. For tenant, region, or service-tier incidents, carry that context into every tool call that supports it.

Limit queries before the model chooses tools

Read-only does not mean low-risk. A read-only agent can still run expensive queries, pull too much sensitive data, or return a misleading report from a wide sample.

Set the limits outside the model loop:

  • Require a service, environment, and absolute time window for incident workflows.
  • Resolve relative windows such as “last hour” before tool calls begin.
  • Cap result sizes for raw logs, traces, exceptions, and dashboard reads.
  • Cap total tool calls and retries per investigation.
  • Cap the elapsed time for unattended jobs.
  • Return an incomplete result instead of waiting for a chat answer that will never arrive.

A good default contract is strict:

Investigate only the supplied service, environment, and time window.
Use read tools only. Keep all queries inside the incident window unless
comparing against a baseline window of equal duration. If the service,
environment, or time window is missing, return MISSING_INPUT. If the
query limit is reached, return PARTIAL with the evidence already collected.

This is not just about cost. It also keeps the report trustworthy. When an agent widens a query silently, it can mix evidence from a different deploy, a different customer cohort, or a different incident.

Last9’s “Build your own AI SRE” docs make this a design requirement: preserve the incident’s service, environment, and time window separately from the model’s written answer, then reuse them in follow-ups. That prevents a later “write the RCA” prompt from losing the original bounds.

Rate-limit numbers are not publicly documented for Last9 MCP. Do not invent them. Limit concurrency and retries in your own agent runtime, test with your workload, and contact support for high-volume agent workloads.

Redact payloads and keep raw evidence out by default

Most incident agents do not need full raw payloads by default. They need metadata, counts, evidence links, and a small number of bounded samples.

Payload exposure happens in several places:

  • log bodies returned to the model;
  • trace attributes and span events;
  • tool arguments and tool results;
  • prompt and completion capture in an agent framework;
  • transcript storage;
  • observability telemetry for the agent itself.

Keep metadata capture on and raw payload capture off. Record the tool name, duration, status, result count, query window, trace ID, log fingerprint, and policy decision. Gate raw log lines, stack traces, request bodies, and tool results behind a policy that names why the payload is needed and for how long.

When you do return payloads, reduce them before they cross the model boundary:

  • filter by service, environment, severity, trace ID, or template;
  • cap the number of raw lines;
  • prefer clustered log templates before raw logs;
  • remove known sensitive fields such as authorization headers;
  • pass resource links or IDs instead of full payloads when the agent only needs a reference.

Last9 Sensitive Data can help with one specific layer: it currently supports logs only, and it detects email addresses, phone numbers, and credit card numbers. It does not make traces, metrics, prompts, completions, or MCP tool payloads automatically safe. For AI telemetry and transcript safety, you still need Collector rules, agent-runtime policy, and payload capture defaults.

Make every agent run auditable

An agent investigation should leave enough of a trail that an engineer can reconstruct what happened without reading the model’s mind.

Record these fields for each run:

  • who or what triggered it;
  • incident ID, service, environment, and time window;
  • agent name and version;
  • credential or token identity, without storing the secret;
  • enabled toolsets and read-only/write-tool policy;
  • every tool call, parameters after redaction, status, duration, and result size;
  • evidence links, trace IDs, alert IDs, dashboard IDs, and log query references;
  • approval requests and approval decisions;
  • failed queries and missing data;
  • final report version.

Audit also has to cover configuration changes around the agent. Last9 Audit Trail records logins, token creation, alerting changes, Control Plane drop and remapping changes, and user-management activity. Last9 MCP adds more attribution for write paths: alert rules and notification channels created through MCP are marked created_via: last9-mcp.

That combination helps with two different questions. The run log answers, “What did the agent do during this incident?” Audit Trail answers, “Who changed the token, rule, drop policy, or alerting configuration around that time?”

Keep both. A model summary is not an audit trail.

Use an allow, approve, deny policy

A readable policy beats a pile of one-off tool decisions. Start with three buckets.

Permission matrix for an incident investigation agent. The allow column lists read-only telemetry tools such as service discovery, logs, traces, metrics, alerts, dashboards, profiles, dependencies, and change events. The approval column lists dashboard edits, alert lifecycle actions, notification-channel changes, drop-rule creation, and remediation actions. The deny column lists shell access, secrets, deploy tools, unrestricted cloud consoles, production databases, and broad export tools.
Use policy buckets before tool names. Then map each bucket to the concrete controls your MCP server and agent runtime support.

Allow by default: read evidence

Allow tools that only read bounded telemetry and metadata:

  • workspace and service discovery;
  • did_you_mean-style entity resolution;
  • logs, traces, metrics, exceptions, profiles, and dependency views;
  • active alerts and alert coverage;
  • dashboards and dashboard previews that do not save;
  • change events;
  • query-status or metric-liveness checks.

These tools still need limits, but they are the core investigation surface.

Require approval: change observability or execute remediation

Require approval for anything that changes shared state:

  • create, update, patch, or delete dashboards;
  • create, patch, mute, acknowledge, reassign, or delete alert rules;
  • create, attach, detach, or delete notification channels;
  • create log drop rules;
  • run deploy, rollback, restart, cache-clear, or feature-flag actions;
  • open tickets that trigger automation.

In Last9 MCP, use --read-only as the default for investigation agents. Add named write tools with --allow-write-tools only for a workflow that has an approval step and a token with the needed scope.

Deny by default: broad production authority

Deny tools that let the model move outside the evidence boundary:

  • production shell and kubectl exec;
  • unrestricted database query consoles;
  • cloud IAM, secret stores, and KMS operations;
  • deploy and rollback systems;
  • broad data export tools;
  • arbitrary HTTP clients with production network reach;
  • tools that reveal long-lived credentials.

If a remediation workflow needs one of these, design it separately. Give it a different identity, a narrower target, a human approval step, and post-action verification.

Where Last9 fits if your agent reads observability data

Last9 MCP is useful when the agent’s job is to investigate production behavior from observability data. It exposes tools for logs, traces, metrics, alerts, dashboards, profiles, service discovery, database investigation, change events, and more through MCP.

The important permission details are documented:

  • Hosted MCP supports OAuth for developer IDEs.
  • Agents and services can use MCP client tokens passed as Bearer tokens.
  • Self-hosted Last9 MCP supports toolsets, --read-only, and --allow-write-tools.
  • Every tool carries readOnlyHint; write tools also carry destructiveHint.
  • Write tools need write-scope tokens, and delete tools need delete scope.
  • Alert rules and notification channels created through MCP are marked created_via: last9-mcp.

That lets you build a real permission boundary instead of relying on a prompt. Use Last9 MCP for tool behavior, MCP for AI agents for bearer-token setup, Query Tokens for token creation, and Build your own AI SRE for the investigation workflow.

Last9’s Agents Monitoring can observe agent behavior alongside production telemetry when your instrumentation emits OpenTelemetry GenAI telemetry. That is separate from permission enforcement, but it helps answer whether the agent loop itself is failing, retrying, or using tools differently after a release.

For high-cardinality service investigations, Last9 has no hard limit: 20M series per metric per day by default, raised on request, with no sampling. That matters when an incident needs labels such as service, environment, route, region, tenant, or deploy version to stay queryable.

Use permissions as the incident boundary

A safe incident agent is not one that promises to be careful. It is one that cannot cross the boundary you designed for the workflow.

Start with read-only telemetry tools. Bind every run to service, environment, and time. Keep raw payloads out unless a policy allows them. Require approval for observability writes and remediation. Deny shell, secrets, deploy, and broad cloud access by default. Then audit every run so the report can be checked against the tool calls that produced it.

That gives the agent enough context to help during an incident without turning it into a second production operator.

FAQ

What permissions should an AI incident agent have?

Start with read-only access to telemetry: service summaries, alerts, exceptions, logs, traces, metrics, profiles, dependency data, change events, and dashboards. Keep configuration writes, dashboard changes, alert changes, drop rules, shell access, deployment tools, secrets, and cloud-console actions outside the default investigation path.

Should an AI agent get production shell access?

No, not for investigation by default. Give the agent brokered read tools that return bounded evidence from logs, traces, metrics, alerts, and change events. If a workflow needs remediation, make it a separate approval path with its own identity, scope, audit record, and rollback plan.

How do you make AI agent investigations read-only?

Use server-side tool filtering where your MCP server supports it, such as read-only mode for tools marked readOnlyHint true. Pair that with client-side allowlists, one credential per agent or workflow, scoped tokens, approval for named write tools, and tests that fail when a disallowed tool is exposed.

How do you prevent PII from reaching an AI agent?

Keep raw payload capture off by default, expose metadata and evidence links instead of full records, redact known sensitive fields before export, and limit log reads by service, environment, time window, and result count. Last9 Sensitive Data currently supports logs only, with email, phone number, and credit-card detection.

How do you audit what an AI agent did during an incident?

Record who triggered the run, which agent identity and token were used, the service and time window, each tool call, query status, returned evidence links, approval decisions, and missing data. In Last9, Audit Trail records token activity and configuration changes, and MCP-created alert rules and notification channels are marked created_via: last9-mcp.

About the authors
Rishi Agrawal

Rishi Agrawal

Rishi builds large-scale observability systems at Last9, focusing on reliable and cost-efficient telemetry infrastructure, and writes about the practical lessons learned while operating ClickHouse, VictoriaMetrics, and OpenTelemetry in production.

Last9 logo and enter key

See Last9 in action.

OpenTelemetry · Prometheus

Just update your config. Start seeing data on Last9 in seconds.

Datadog · New Relic · Others

We've got you covered. Bring over your dashboards & alerts in one click.

Built on Open Standards

100+ integrations. OTel native, works with your existing stack.