Safeguard
Developer Tools•

Which security metrics should you track after an AI coding agent rollout?

Track blocked actions, approval rates, agent-added dependencies, review depth, and credential age. Six metrics that show whether agent controls work.

Safeguard Security Team
7 min read

Track six things after rolling out an AI coding agent: how many actions policy blocked, how often people approve prompts, how many dependencies agents add and how many fail checks, how deeply agent pull requests are reviewed, how old agent credentials are, and how many tools or servers are not on the approved list.

Why measure at all

Controls drift. A setting changes, a developer flips an auto approve flag, a new server gets connected. Metrics tell you when the world differs from your policy. They also give leadership something firmer than a feeling.

Pick few metrics and define each one precisely. Dashboards with thirty tiles get ignored.

The six

MetricDefinitionWhat it tells you
Blocked action countAgent actions refused by policy per weekControls are active, and what people try to do
Approval rateShare of risky prompts that are approvedVery high means rubber stamping, very low means friction
Agent dependency intakeNew packages added in agent pull requests, and the share failing a checkQuality of what agents pick
Review depthTime to first review, comments per pull request, share merged without commentWhether humans are really reading
Credential ageMedian age of agent tokens, and count past expiryHygiene of the identity layer
Unapproved toolsConnected servers or extensions not on the allowlistShadow use and inventory gaps

How to read them

Blocked actions. A count of zero is suspicious, not reassuring. It may mean nothing is enforced or nothing is logged. Look at what is blocked: repeated attempts to reach a new host deserve a look.

Approval rate. If nearly every prompt gets approved within a second, the prompts are noise. Shrink the prompt set to the risky tier, as described in our post on whether agents should run commands without approval.

Dependency intake. Compare agent pull requests with human ones. A higher failure rate for agent added packages points to guardrails or prompts that need work.

Review depth. An agent pull request merged with no comments and a ten second review is a warning. Combine it with diff size.

Credential age. Old tokens are the stale keys of the agent world.

Unapproved tools. Needs an inventory. Developers add servers through local config, so scan for it.

Avoid vanity numbers

Lines of code produced, suggestions accepted, and hours saved are productivity measures. They have a place, but they say nothing about risk. Keep them on a separate page so nobody confuses the two.

Set thresholds and owners

For each metric, write a trigger and an owner. Example: "If median agent token age passes thirty days, the platform team rotates and reports." A metric without an owner is a chart.

Review cadence

Look weekly during the first month, then monthly. Compare against the baseline you set during the pilot. The OWASP Top 10 for LLM Applications is a useful lens for choosing what to watch: Excessive Agency (LLM06) suggests tracking permissions, and Supply Chain (LLM03) suggests tracking intake of components.

Close the loop

Every review should end with one decision: tighten a control, loosen a friction point, or leave things alone. A metric that never changes a decision can be dropped.

Safeguard can help at the dependency and pipeline end of this: SBOM and dependency scanning, reachability analysis, policies and gates on pull requests, and agent identity. You can try a free scan at gold.safeguard.sh/scan.

A worked example: a first month dashboard

Imagine a team with fifteen developers and one sanctioned agent. After thirty days they have these numbers.

MetricWeek 1Week 2Week 3Week 4
Blocked actions12943
Approval rate on risky prompts97 percent96 percent85 percent78 percent
Agent added dependencies61189
Share failing a dependency check33 percent27 percent12 percent11 percent
Agent pull requests merged with no comments70 percent62 percent40 percent33 percent
Median agent token age (days)391622
Unapproved tool servers found4311

How to read it. Blocked actions fell as developers learned the boundaries, which is healthy. The approval rate near 97 percent in week one signaled rubber stamping, and it fell after the team trimmed the prompt set and added short training. The failure share on dependencies fell after a policy gate was added. The merged without comment share is still high at 33 percent, so the team schedules a reviewer session. Median token age is climbing, which means rotation is not automated yet, and that becomes the next fix.

Percentages here are an illustration of how to read a dashboard, not benchmarks for your team.

Defining each metric precisely

MetricNumeratorDenominatorSource
Approval ratePrompts approvedPrompts shownTool or wrapper log
Dependency failure shareAgent added packages failing a checkAgent added packagesPipeline results
No comment mergesAgent pull requests merged without commentAgent pull requests mergedSource control
Token ageMedian days since issueActive agent tokensIdentity system

Writing definitions down stops arguments about whether a number moved or the definition did.

Thresholds and actions

  1. If approval rate stays above 95 percent for two weeks, shrink the prompt set.
  2. If the dependency failure share rises, review the guardrails and the agent's instructions.
  3. If median token age passes your limit, rotate and automate expiry.
  4. If unapproved servers appear, run the vetting steps or remove them.
  5. If blocked actions spike for one user, talk with them before assuming bad intent, since they may be doing legitimate work that the policy mishandles.

Reporting upward

Leadership wants three lines: are controls working, what changed this month, and what we are fixing next. Use a single page, with trend arrows and one sentence each. Keep the detail available but not on the first page.

Pair with a risk register

Record any metric that stays red in your risk register with an owner and a date. That connects the numbers to decisions, which is the whole point of measuring.

Try it yourself

Click through it at your own pace, or open it full screen.

Click through and notice how findings are tracked and prioritized over time.

Quick check

Is zero blocked actions good?

Not by itself. Confirm that enforcement and logging work by running a test that should be blocked.

How many metrics should we start with?

Six or fewer, each with a definition, a threshold, and an owner.

Should we compare agent pull requests with human ones?

Yes, on review depth and dependency failures. Differences show where agent specific guardrails or reviewer habits need work.

Sources

Last reviewed: 19 October 2026.

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.