Dev.to Security 🔐 Cybersecurity 👁 0 📖 7 min read

Ghost Agents: 82% of Companies Are Running AI Agents They Never Approved

Most companies can tell you exactly how many employees they have. Ask how many AI agents are running inside their systems right now — reading email, touching the CRM, moving data between tools — and the room goes quiet.

Most companies can tell you exactly how many employees they have. Ask how many AI agents are running inside their systems right now — reading email, touching the CRM, moving data between tools — and the room goes quiet.

That silence is the story. The Cloud Security Alliance surveyed 418 IT and security professionals in January 2026 and found that 82% of enterprises discovered AI agents in their infrastructure they didn't know existed. Not in a one-off audit, either: 41% found shadow agents multiple times. And 65% had already suffered an AI agent-related security or operational incident in the previous twelve months.

Your next agent problem isn't the one you're building. It's the dozen already running that nobody owns.

The inventory you don't have

Shadow IT was a spreadsheet problem. Someone installed an unapproved app, IT found it in a licence audit, and that was the end of it. Shadow agents are different in kind, not just in degree.

An unapproved app sits still until a human opens it. An agent acts on its own — on a schedule, on a trigger, on a sentence buried in an email it was never supposed to follow. The Cybersecurity Insiders AI Risk and Readiness Report 2026 (1,253 cybersecurity professionals surveyed) found that 91% of organisations only discover what an AI agent did after it already executed the action. That is not a monitoring gap. That is an organisation learning about its own systems from the audit trail after the fact.

The confidence gap makes it worse. In the same CSA survey, 68% of respondents claimed high confidence in their visibility into their AI agent footprint — the same population in which 82% had just found agents they didn't know about. Confidence and coverage are moving in opposite directions, and confidence is winning the argument in most boardrooms.

Meanwhile the build rate is outrunning governance entirely. Dataiku's Global AI Confessions Report (Harris Poll, 685 CIOs, July 2026) found that 81% of CIOs say they have lost oversight of their own organisation's AI agents, and 84% say employees are building new agents faster than IT can govern them. These aren't rogue outsiders. They're the company's own agents, built inside the company, operating beyond the view of the people nominally responsible for them.

Why agents break every assumption shadow IT relied on

Three properties make an agent harder to govern than any software that came before it:

1. Agents have identity, not just access. A script runs as a user. An agent increasingly runs as itself — its own credentials, its own API keys, its own OAuth tokens. When it does something wrong, the log shows a service account nobody remembers creating. Revoking a person doesn't revoke the agent. The Cloud Security Alliance survey found only 21% of organisations have a formal decommissioning process for agents. The other 79% are accumulating digital employees who can never be fired.

2. Agents interpret, they don't just execute. A workflow does exactly what its flowchart says. An agent reads an instruction, decides what it means, and acts. That interpretation step is where scope creep lives: the CSA survey found 53% of organisations have seen agents exceed their intended scope, and Cloudera's field report puts the figure at 80% reporting agents taking unauthorised actions or accessing systems beyond their scope. The agent didn't malfunction. It misunderstood — confidently, and at machine speed.

3. Agents compound. One agent calling another agent's output is a chain nobody designed. A triage agent misreads a customer email, a second agent acts on the misread data, a third writes the wrong result back into the CRM as truth. Each step looked reasonable in isolation. The system as a whole did something no human would have approved. Gartner expects the average Fortune 500 enterprise to be running more than 150,000 AI agents by 2028, while only 13% of organisations believe they have the right governance in place to manage them.

The three controls that actually work

You cannot govern what you cannot see, and you cannot see agents by asking teams to fill in a spreadsheet. The controls that work are structural — they make an ungoverned agent unable to run, rather than merely against policy.

1. An agent registry with teeth

Every agent gets a manifest before it gets credentials. No manifest, no API key — enforced by the platform, not by a policy document. A minimal manifest looks like this:

agent:
  name: invoice-triage
  owner: [email protected]
  purpose: Classify incoming supplier invoices and route to approvers
  allowed_tools:
    - gmail.read
    - drive.read
    - slack.post #approvals-channel
  forbidden_tools:
    - gmail.send
    - crm.write
    - payments.*
  data_classification: internal
  review_date: 2027-02-01
  kill_switch: https://internal.example.com/agents/invoice-triage/disable

The two fields that matter most are the ones teams skip: owner (a named human, not a team) and review_date (an expiry, not a creation date). An agent with no owner and no expiry is a ghost by definition. If your platform can't enforce "no manifest, no credentials", that is the first thing to fix — before you build another agent.

2. Least privilege, enforced at the tool layer

Most agents get the permissions of whoever built them, which usually means far more than the task needs. The fix is boring and it works: scope every tool call to the minimum the task requires, and make write access a separate, explicit grant.

# Every agent action passes through one gate.
# The gate checks the manifest — not the model — before anything executes.
def execute_action(agent, action):
    if action.tool not in agent.manifest.allowed_tools:
        audit_log.deny(agent, action, reason="tool not in manifest")
        raise PermissionDenied(f"{action.tool} is not approved for {agent.name}")
    if action.is_write and not agent.manifest.write_approved:
        audit_log.deny(agent, action, reason="write access not granted")
        raise PermissionDenied(f"write access requires approval for {agent.name}")
    result = action.run()
    audit_log.record(agent, action, result)
    return result

Notice what this does: the model never decides its own permissions. The manifest does. If an agent is tricked by a prompt injection into attempting a payment, the gate refuses before the tool runs — and the refusal itself is logged, which is how you discover the attack.

3. An audit log a human actually reads

Logging everything is easy. Reading it is the hard part. The practical version: every agent action writes a structured record (who, what tool, what data, what result), and a weekly review flags three patterns — actions outside the manifest, actions at unusual hours, and actions touching data the agent has never touched before. The Cybersecurity Insiders report found 94% of organisations report gaps in AI activity visibility; the gap is rarely missing logs. It's missing anyone looking at them.

The 30-minute ghost hunt

Before you build your next agent, spend half an hour counting the ones already running:

  1. List every API key and service account created in the last 12 months. Any key whose owner left, whose purpose is "testing", or whose creator can't be named is a ghost until proven otherwise.
  2. Check your SaaS audit logs for OAuth grants to AI tools — Zapier, Make, n8n, custom GPTs, Copilot Studio, and every "connect your inbox" prompt employees clicked.
  3. Search your code repos for agent framework imports (LangChain, CrewAI, AutoGen, OpenAI Agents SDK) in projects that never went through an architecture review.
  4. Ask finance which AI tools appear on expense reports or corporate cards. Shadow agents often show up in billing before they show up in IT.
  5. Put a name and an expiry date on everything you find. Anything that can't get an owner in a week gets its credentials revoked. That sounds harsh until you remember that 65% of enterprises in the CSA survey already had an agent-related incident.

The real question isn't what agents can do

The demos keep getting better and the inventory keeps getting worse. Gartner predicts over 40% of agentic AI projects will be cancelled by the end of 2027 — not because the technology failed, but because of escalating costs, unclear business value, and inadequate risk controls. The cancellations won't be the technology's fault. They'll be the governance's.

So the question for your next agent project isn't "what can it do?" It's "who owns it, what exactly is it allowed to touch, and how would we know if it did something wrong?" If you can't answer all three before it gets credentials, you're not deploying an agent. You're adopting a ghost.

I break down systems like this daily — follow for more on building AI automation that survives contact with production.

Sources: Cloud Security Alliance, "Autonomous but Not Controlled" (survey of 418 IT and security professionals, January 2026, commissioned by Token Security); Dataiku Global AI Confessions Report: CIO Edition 2026 (Harris Poll, 685 CIOs, July 2026); Cybersecurity Insiders AI Risk and Readiness Report 2026 (1,253 cybersecurity professionals); Cloudera, "The Agentic Reckoning" field report; Gartner agentic AI governance and cancellation forecasts.

📰 Read the original article on Dev.to Security

Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.