The Real AI Security Risk Is What We Allow It to Do

The Real AI Security Risk Is What We Allow It to Do

Mike Shelton

Head of Pentesting

For years, giving too many permissions has been one of the top reasons for serious security problems.

A service account might have more access than it actually needs. An API token stays valid longer than it should. A workload might reach systems it was never meant to access. One weak permission alone doesn’t always cause a breach, but it adds a step in a possible attack chain.

AI agents make this issue even more serious.

Traditional services usually only do what developers have explicitly told them to do. But an autonomous agent can look around its environment, test ideas, change tactics if something fails, and keep trying to achieve its goal.

The OpenAI and Hugging Face incident showed what this can look like in real life.

A Narrow Goal Can Still Lead to a Wide Attack Chain

During an internal security test, OpenAI’s models were asked to solve exploitation challenges in a contained environment. They weren’t supposed to have internet access. Package installation was routed through an in-house proxy that cached packages.

But instead of sticking to that limit, the models looked for a way around it.

They found and exploited a zero-day vulnerability in the package proxy, gained higher privileges and moved laterally within the research environment, and eventually reached a system with internet access. From there, they identified Hugging Face as a potential info source for the benchmark and kept pursuing it. OpenAI said the models used stolen credentials and other vulnerabilities to gain remote code execution on Hugging Face’s infrastructure.

The models weren’t out to do something malicious, they were just focused on completing the benchmark. But that’s what makes this incident important.

An autonomous system doesn’t have to be malicious in the usual sense to cause a security issue. It just needs an objective, the ability to take actions, and an environment where unintended paths exist.

Least Privilege Means Something Different for Agents

Least privilege has always meant giving a user or service only the access needed for their job. For an AI agent, that definition isn’t enough anymore.  

It’s not just about what permissions the agent starts with. It’s also about what it can discover, request, create, steal, or reach as it works toward its goal.

An agent with access to a shell, the ability to install packages, local files, APIs, service credentials, cloud metadata, internal services, or network tools might combine those capabilities in ways system designers never expected.

Each permission might seem reasonable on its own, like needing package installation for development, API access to get info, service accounts for tasks, network access to reach systems, or time to complete complex goals.  

But problems come up when the agent starts chaining those capabilities together.

This is the same issue security teams face with overprivileged services, they just can’t actively search for weaknesses, change tactics, and keep operating without human intervention.

The Security Boundary Is Outside the Model

Security measures at the model level matter, but they’re not the only controls.  

The real security boundary includes the agent’s identity, tools, environment, network access, credentials, approval processes, and monitoring.

Organizations using agents should be able to answer key questions like:  

What systems can the agent reach?  

Under what identity does it operate?  

Can it create or get new credentials?  

Can it install software or run arbitrary code?  

Can it communicate with unapproved locations?  

Which actions need human approval?  

Can its credentials or connections be revoked instantly?  

Can the organization track everything the agent did?

If these aren’t clear, it’s not just a governance problem with AI. It’s an issue with identity, architecture, and access controls overall.

Autonomy Changes How a Weak Control Impacts Security

A regular app might just fail or stop working on an unexpected error.  

An agent might interpret that same error as an obstacle and try a different approach.

That matters when the agent is working with real systems. A missed network restriction, a vulnerable internal service, exposed credentials, or an overly broad role isn’t waiting for a human attacker to find and exploit it. The agent itself might do that work.

OpenAI said the models involved could run complex, multi-step cyber operations and find new attack paths even without access to source code.

That shows organizations can’t assume an agent will only use tools as originally intended. The architecture must technically enforce those boundaries.

The Defensive Asymmetry Problem

The second part of the incident might be just as crucial as the breach itself.

Hugging Face used AI-driven analysis to go through over 17,000 recorded events, spot affected credentials, gather indicators of compromise, and separate real activity from decoys. This helped the response team finish tasks in hours instead of days.

But they ran into an unexpected issue.  

Their initial commercial models couldn’t handle the volume of attack commands, exploit payloads, and C&C (command-and-control) artifacts needed for the investigation. Security safeguards blocked the requests because they couldn’t reliably tell apart an incident responder from an attacker.

Instead, Hugging Face used an open-weight model, GLM 5.2, hosted within their own environment. This prevented attacker data and credentials from leaving their infrastructure.

This creates an asymmetry that defenders need to plan for. Attackers might use unrestricted, custom, or self-hosted models. Defenders depend on hosted services that might refuse to process malicious evidence during an incident.

Safety controls are essential, but an incident is the worst time to find out that a key defensive tool can’t analyze real attack data.


AI Incident Response Has to Be Tested Before an Incident Happens

Organizations planning to deploy AI for security should test their workflows under real-world conditions.

It’s not enough to verify that a model can summarize a clean alert or explain a sanitized malware sample. The real test is whether it can handle live exploit commands, encoded payloads, credential references, attacker infrastructure, and thousands of related events without refusing, leaking info, or losing critical context.

Defenders need to understand what their providers will allow, what escalation options exist, and whether hosting a local version is necessary for sensitive cases.

That fallback can’t be improvised in the middle of an attack.  

It should be tested through drills and built into the incident response plan, with the same logging, access controls, and data handling as the rest of the security system.

AI agents don’t make least privilege less important. They make failures in those protections more dangerous.

An overprivileged traditional service might expose an attack route. An autonomous agent can find, test, and exploit that route, all without human oversight.

And defenders can’t assume any AI security tool will keep working when malicious content is scaled up or twisted during an attack.

Organizations need to weigh both sides: what authority are we giving the agent? And will our defense tools still work if the agent, or someone using it, turns that authority against us?

The lesson from this incident isn’t to avoid AI agents.

 

It’s to stop treating them like ordinary software integrations.