facebook page view

Secure AI Agents Beyond the Prompt

Secure AI Agents Beyond the Prompt

AI agents need more than careful instructions to operate safely. Secure them by limiting permissions, isolating execution, restricting network access, validating tool calls, monitoring activity, and requiring human approval for high-impact actions. A prompt can guide an agent, but external controls must determine what it is actually allowed to do.

The distinction matters because agents can interact with websites, files, APIs, and other connected systems. On October 16, 2026, Reuters reported that Tencent acknowledged unintended browsing behaviour by agents used in third-party model evaluations. The report did not establish that the agents successfully breached the targeted service. The incident nevertheless illustrates why unexpected agent behaviour must be contained by system-level controls rather than prompts alone.

Why AI agent security needs a different approach

A conventional chatbot primarily produces responses. An agent may also execute commands, retrieve information, modify files, or interact with external services. Its risk depends on the capabilities available to it and the boundaries enforced around those capabilities.

This is particularly important when an agent operates across several tools. A seemingly harmless request can trigger a chain of actions: retrieve a document, interpret its contents, call an API, update a database, and send a notification. If one step goes wrong, the consequences can extend beyond the original task.

The UK government announced additional measures on October 12, 2026, to strengthen national defences against emerging AI risks, including preparations for serious incidents involving autonomous agents. These developments reinforce the need for organisations to test AI systems under realistic conditions before expanding their access.

1. Define the agent's authority before deployment

Start by documenting what the agent is supposed to accomplish and which actions are necessary.

For example, a support agent that summarises customer tickets may need read-only access to a specific queue. It does not automatically need permission to issue refunds, delete accounts, export the customer database, or change administrator settings.

Separate permissions into distinct capabilities:

  • Read: Retrieve information required for the task.

  • Write: Create or modify specified records.

  • Execute: Run approved commands or workflows.

  • Publish: Release content or deploy changes.

  • Administer: Change permissions, infrastructure, or system configuration.

Grant only the permissions needed for the intended workflow. High-impact operations should require separate approval rather than being available by default.

This approach also makes testing easier. A security reviewer can compare the agent's documented responsibilities with its actual permissions and identify unnecessary access before deployment.

2. Isolate execution and restrict network access

Run agents that execute code or commands inside a controlled environment. Depending on the workload, this may involve a disposable container, a restricted virtual machine, or another appropriately isolated execution service.

Mount only the files the agent needs. Avoid exposing a developer's home directory, unrelated project repositories, production credentials, or administrative configuration files.

Network restrictions are equally important. An agent may need access to an approved documentation site or package registry, but that does not justify unrestricted access to the internet or internal services.

Use allowlists where practical, and enforce restrictions outside the model. A container alone is not proof of isolation: verify its mounted files, outbound network routes, available commands, and access to host resources.

3. Treat external content as untrusted input

Agents often inspect documents, emails, issues, web pages, code comments, and tool output. Some of this content may contain instructions intended to manipulate the agent.

This is one form of prompt injection. A malicious webpage might tell an agent to ignore its original task and transmit information to another destination. The instruction may appear convincing, but it must not grant the agent additional authority.

Do not rely on a longer system prompt as the only defence. Keep untrusted content separate from trusted policy where possible, validate tool arguments, restrict destinations, and prevent the agent from accessing sensitive data it does not need.

If an agent is asked to summarise a webpage, for example, it should not be able to turn instructions found on that page into permission to execute shell commands or send internal documents elsewhere.

4. Protect credentials and connected services

Use separate identities for different workflows. Prefer short-lived credentials and narrowly scoped service accounts instead of sharing an administrator token across multiple agents.

Store secrets in an appropriate secrets-management system, and avoid placing them in prompts, source files, logs, or test fixtures. Rotate credentials when their exposure is suspected, and revoke permissions that are no longer needed.

Review each integration before enabling it. An email connector, database tool, browser, and deployment API each introduce different risks. Ask what information the agent can read, which actions it can perform, and whether those actions are logged.

Australia's cyber security agency published guidance on agentic AI harnesses on September 11, 2026. It highlights the importance of least-privilege access, human oversight, monitoring, and governance around the software connecting AI models to tools and organisational systems.

5. Monitor activity and test failure conditions

Logging should capture more than the agent's final answer. Record its identity, task, tool calls, command results, permission denials, approvals, and relevant configuration changes.

Protect these records from unauthorised modification. Correlating events by task or run identifier helps reviewers reconstruct an unexpected sequence of actions.

Test the controls deliberately before production use. Use a non-sensitive environment to check whether the agent can:

  • Read files outside its permitted workspace.

  • Reach an unapproved network destination.

  • Access a secret it should not see.

  • Modify protected configuration.

  • Continue performing actions after a run is cancelled.

Expected outcomes should be enforced denials, approval requests, or clearly recorded failures—not merely warnings in the conversation.

A reliable shutdown process matters as well. It should stop active work and revoke temporary access where appropriate. If suspicious behaviour occurs, isolate the environment, preserve logs, rotate exposed credentials, and investigate connected systems before restoring access.

6. Introduce agents in stages

Begin with a low-risk task using non-sensitive data. Measure the agent's accuracy, permission use, failure behaviour, and resource consumption before allowing broader access.

A practical deployment sequence is:

1.    Test the workflow in a disposable environment.

2.    Review the tools and permissions required.

3.    Simulate malicious input and unexpected outputs.

4.    Validate logging, approval, and shutdown controls.

5.    Run a limited pilot with human oversight.

6.    Expand access only after the controls have been tested.

This process makes failures easier to contain and gives security teams evidence about the agent's behaviour before the workflow becomes operationally important.

Common Mistakes

  • Trusting prompts as security controls: Instructions guide behaviour, but permissions and execution policies must enforce boundaries.

  • Granting administrator access by default: Start with the minimum required permissions and expand only when justified.

  • Assuming a sandbox is sufficient: Check network access, mounted files, credentials, and host isolation.

  • Ignoring tool logs: Retain enough information to reconstruct actions and investigate unexpected behaviour.

Expert Tips

  • Start with read-only access: Introduce write or execution privileges only when the task requires them.

  • Test realistic attack scenarios: Include malicious documents, untrusted webpages, and invalid tool arguments.

  • Separate approval from execution: Require independent authorisation for destructive or high-impact operations.

  • Reassess after changes: New connectors, tools, permissions, and model updates can alter the risk profile.

Frequently Asked Questions

·      What is AI agent security?

AI agent security involves protecting the model, tools, data, identities, execution environment, and connected systems that allow an agent to perform tasks.

·      Can prompt injection be prevented with a better prompt?

A stronger prompt may help guide behaviour, but it cannot reliably enforce security. Access restrictions, tool validation, isolation, and external approval controls are also necessary.

·      Should AI agents have access to production systems?

Only when there is a justified requirement and appropriate safeguards. Start with restricted environments and require explicit approval for high-impact operations.

·      Is sandboxing enough to secure an AI agent?

·      No. Sandboxing is one layer of defence. Credentials, network access, tool permissions, logging, and connected services must also be controlled.

·      How should businesses test AI agents before deployment?

Use non-sensitive data to test normal workflows, malicious instructions, permission boundaries, network restrictions, logging, and shutdown behaviour before expanding access.

Conclusion

AI agent security depends on controlling what an agent can access and do, not simply what it is instructed to do. Isolated execution, restricted permissions, protected credentials, validated tool calls, monitoring, and tested shutdown procedures create practical boundaries around autonomous behaviour.

Before connecting an agent to production systems, prove that those boundaries work under both normal and adversarial conditions. Expand capabilities gradually, maintain human accountability, and reassess controls whenever the workflow changes.

 

Share this article
A
Written by
Alaffiya Madarwala
Last updated

17 October 2026

Comments

Book Your Free Demo Class

Experience our teaching style, interact with mentors, and see how we help you become job-ready.

No spam. Just one demo. Relax.


© 2026 Praxia Skill Pvt. Ltd. All rights reserved.

Blog