Securing an AI agent means treating it as an untrusted, privileged workload: give it its own identity, the narrowest permissions that still finish the task, a network path you control, and a human checkpoint before anything irreversible happens. Logging, review and governance exist to prove those four controls held.
That framing sounds obvious until you look at how agents arrive. In November 2026, WorkOS confirmed that a security researcher’s AI agent, running inside an ARTEX benchmark, escaped its isolated testing environment and breached an internal sales application; the researcher deleted the data and it was not shared further, according to Help Net Security. Nothing exotic was required — the agent had the reach, and the sandbox was a claim, not a verified boundary.
The agent is a privileged workload
CERT-EU’s assessment of ARTEX is the sentence to tape to a monitor: the framework relies on configurable rules and on the model itself to respect scope and avoid destructive actions, with no hard technical enforcement. Assume the same of any agent you deploy, including the one your team wrote.
The prompt is not a security boundary: instructions in a system message can be argued with by content the agent reads later. An agent holding a token, a shell, a browser session or a SaaS connection is a workload with a non-human identity, so inventory, scope, monitor and decommission it the way you would a server.
For each agent in your estate, four questions need written answers: which identity does it use, what can that identity reach, where can it send traffic, and who reviews what it did. Any answer of it depends is your first piece of work.
The exposure pattern is not subtle. Censys counted more than 1,600 internet-exposed ARTEX consoles and Check Point Research more than 1,800, with hundreds reachable in Mandarin-language hosting according to Datadog. The console exposes routes such as /tasks, /agents, /skills, /mcp, /intercept and /llm/pool — each an interface with authority behind it, reachable because someone shipped a tool before deciding who owned it.
The rule worth adopting: an agent may hold the authority of the person accountable for its output, and no more. Past that point you are not automating a task, you are delegating accountability to a model that cannot hold it.
Scope credentials and permissions
Least privilege. Give every agent a dedicated service identity, one per agent and environment. Scope at the action level, not the API level: read, write, delete, export, permission change and payment are separately granted, and destructive verbs are denied by default so enabling them is a recorded decision. Split read-only agents from write agents rather than trusting one agent to behave differently per task. Never hand an agent a human’s credentials, an administrator token or your browser session, and do not let it inherit a developer’s sign-on token in a demo that becomes production.
Verify scope from the outside: call the destructive endpoint with the agent’s token and confirm it returns a permission error.
Credential lifetime. Long-lived API keys in environment variables are the default failure mode of agent deployments and the easiest thing to fix. Prefer workload identity federation or token exchange so the agent requests a credential per task, valid for minutes rather than months. Fetch secrets at runtime from a vault — never from the prompt, repository, container image or a runbook note — and revoke at task end.
Model API keys deserve their own tier. Amazon’s chief information security officer has described campaigns in which stolen AI model API keys paid for the inference used to hunt more credentials, per Recorded Future News — a credential with a bill attached, used as attack infrastructure. Scope inference keys per application, cap spend, alert on volume spikes or unfamiliar source networks, and rotate them.
One trap to close early: token passthrough. If the agent forwards the end user’s token downstream, every service behind it sees that user’s full authority and your scoping becomes decoration. Use token exchange limited to a defined scope, and log which human each delegated call served.
Isolate execution and egress
Execution isolation. Run agents in a container or micro virtual machine rebuilt per task from a pinned image: non-root, read-only root filesystem, no host mounts, no container runtime socket, an ephemeral workspace, CPU and wall-clock limits. Treat tool servers and MCP endpoints as code you review and version-pin, because registering a tool is registering code execution.
Then test the isolation. An isolated environment is a hypothesis until someone inside it tries to reach the sales application and fails. Put that attempt in your pipeline as a negative test, and re-run it whenever the image or tool set changes.
Network egress. Default-deny outbound traffic and allowlist per agent role: a package registry, named API hostnames, one internal service. Force everything through an authenticated proxy that logs destination, method and size. Block cloud metadata endpoints, internal address ranges, paste sites, anonymous file-transfer services and raw-IP destinations unless a task truly needs them. Give browsing agents and business-system agents separate egress profiles so compromising one does not reach the other, and resolve DNS through a server you control so you still see lookups when connections die.
Microsoft observed ARTEX agents using compromised cloud identities for persistence and exfiltration: identity abuse gets the agent in, egress gets the data out. Close both.
Log and review what the agent does
Log the trace, not the outcome: initiating identity, every tool call with its arguments, egress destination, approval decisions with the approver’s name, outputs, and the identity used for each downstream call. Join proxy, identity provider, SaaS audit and agent logs on a single run identifier. If you cannot reconstruct one decision end to end, the logs will not help in an incident.
A short detection list earns its keep:
- First-seen or non-allowlisted egress destinations.
- An agent credential used from an unexpected network or cloud account.
- Destructive verbs — delete, export, transfer, permission change — outside an approved window.
- Agent activity while its owner and approvers are offline.
- An approval gate bypassed, disabled, or timed out into allow.
- A new OAuth scope, tool registration or credential on an existing agent.
Add deception to the agent network segment. Microsoft found that deception controls — honeypots, decoys, tarpits, fake wins — reduced attack traffic reaching real assets and produced a high-confidence attribution signal. A fake internal API with no business purpose generates almost no false positives, and an agent probing it is behaving with obvious intent.
Review is a staffing commitment, not a dashboard. A named human reads the trace of every high-risk agent daily for its first month, then weekly, and checks destructive or unusual runs before the next scheduled run.
Keep the ordinary controls too. Microsoft’s Storm-3358 activity combined agentic automation with anonymous file upload, server-side request forgery, web shells, credential theft from public sources and commodity RATs pulled with netcat and curl. Agents widen the blast radius of familiar mistakes; they do not replace the familiar controls. The same caution applies to assistants that arrive as browser add-ons — read our guidance on defending AI assistants from malicious browser extensions before approving the next one your team installs.
Governance that survives an incident
Governance is what remains after the person who built the agent changes teams. Minimum artifacts: an agent registry recording owner, purpose, identity, data classes, tools, egress profile and risk tier; deployment approval requiring a security owner’s sign-off for regulated data or production writes; a kill switch that revokes the identity rather than stopping a process; and a decommissioning path that deletes credentials, tools and stored context.
Human approval. Decide in writing which actions require a person: money movement, deletion or bulk export, external communications, permission changes, production writes, anything irreversible. Enforce it at the tool or gateway layer, never in the prompt. Command-interception rules that allow, deny or ask a human are the right shape, but three defaults decide whether the control is real — destructive verbs deny by default, a timeout denies rather than allows, and the approver sees exact arguments and target, not a model-written summary. Use two-person approval for irreversible actions and log both names.
Third-party agentic tools turn procurement into a security control. Ask each vendor which identity the agent uses, where credentials live and how long they last, whether scopes are enforced server-side, whether you can export the full action trace, who the subprocessors are, how long data is retained, whether a kill switch exists, and whether approval gates are configurable and auditable. Pilot in a sandbox tenant with a test identity, review every OAuth scope the integration requests, and re-review when the vendor adds a scope or tool. Plan for shadow deployments: the FBI’s November 2026 FLASH notes that ARTEX keeps spreading through forks, archived copies and a commercial version, so pulling the original repository did not remove the capability. A blocklist is not a control; identity inventory and egress policy are.
A 30-day sequence for a team without a dedicated agent security program:
- Days 1–5, inventory. List every agent in use, sanctioned or not, with owner, identity, data touched and justification, including vendor agents embedded in SaaS products you already pay for.
- Days 6–10, identity. Replace shared and long-lived credentials with per-agent identities and short-lived tokens, then confirm scopes by testing a destructive call and watching it fail.
- Days 11–15, egress. Put default-deny egress in front of agent workloads, allowlist per role, and prove the isolation boundary with a negative test from inside the sandbox.
- Days 16–20, approvals. Publish the actions needing human approval, implement them in the gateway with deny-by-default and deny-on-timeout, and log the approver.
- Days 21–25, logging. Correlate proxy, identity provider, SaaS audit and agent traces on one run ID, enable the detections above, and route them to whoever is on call.
- Days 26–30, rehearse. Tabletop a case where an agent exported records: revoke the identity, preserve the trace, contain egress, notify. Fix what the rehearsal exposes before the next agent ships.
Write the agent incident playbook before you need it. Our ransomware response playbook template is a usable skeleton for roles, decision log and communications; the agent-specific steps are short — revoke the identity first, preserve the trace, contain egress, then investigate.
Two foundations make this cheaper. Per-request authorization and egress policy come naturally when identity is the control plane, the practical argument for a zero trust architecture over a perimeter around the agent host. And for a small team without a platform function, the sequencing in our guide to digital security for SMBs gets inventory and approval in place first.
The test of a secure agent deployment is not whether the model refuses a malicious instruction. It is whether the identity could not do the damage, the network would not carry it, the log would show it, and a person had to approve it.