Dev.to AI 🤖 Ai 👁 0 📖 9 min read

When AI Agents Go Rogue: Who Is Watching the Agents That Run Your Business?

When AI Agents Go Rogue: Who Is Watching the Agents That Run Your Business? AI agents are no longer just answering questions. They can call APIs, look up company data, update records and run multi-step workflows across s

When AI Agents Go Rogue: Who Is Watching the Agents That Run Your Business?

When AI Agents Go Rogue: Who Is Watching the Agents That Run Your Business? AI agents are no longer just answering questions. They can call APIs, look up company data, update records and run multi-step workflows across several apps. In some setups, they can finish a whole process with very little human help. For developers, that is exciting. We are moving from software that responds to software that acts. But before we hand these systems more responsibility, one question needs a clear answer: What happens when an agent does something it was never supposed to do?

A small example that shows the problem

Imagine an agent that handles vendor invoices. It reads an invoice, finds the matching purchase order, checks the amount and prepares a payment request. Now the invoice arrives with a bank account number that does not match the one on file for that vendor. This happens in real life, and it is a common way payment fraud starts. The agent does not notice. It follows its steps and prepares the payment using the wrong details. Every technical step worked. The business result is still a disaster. That is the gap between an agent that can do a task and an agent that can be trusted to do it. Building clever agents is the easy part now. The harder part is controlling what they can see, what they can do, and how we can review what they did. Let's look at the engineering side of that.

1. Why autonomy creates a new kind of risk

Traditional software follows paths that developers wrote in advance. An agent works differently. It reads a request, decides which tools to use, pulls in information, and picks its next step based on the context it has.

Take a customer-support agent. A single complaint might lead it to: 1. Read the complaint 2. Open the customer's account 3. Check the transaction history 4. Work out the problem 5. Start a refund 6. Update the CRM 7. Send a confirmation Every extra step is another place where something can go wrong. The agent might: Pick the wrong customer record Misread a document it retrieved Call an API it should not call Repeat an action and create duplicate records Reach data beyond what its job needs Follow hidden instructions planted in outside content (this is called prompt injection) None of these need a "bad" model. They often come from how the whole system around the model is designed. A good prompt is not enough. A reliable agent needs a controlled place to run.

2. Runtime guardrails: stop unsafe actions before they happen

A system prompt can tell an agent "never approve payments above ₹5 lakh." But that is a request to the model, not a lock. Nothing in the prompt stops the agent from producing an API call for ₹7 lakh. So the check has to live somewhere else: a control layer that sits between the agent and its tools.

`Agent proposes an action
-> Policy check (outside the agent)
-> Allow / Block / Ask a human
-> The tool runs only if permitted

Here is the idea in a few lines of Python:`

def check_action(action: dict) -> str:
# Runs outside the agent's own reasoning
if action["tool"] == "create_payment":
if action["amount_inr"] > 500_000: # ₹5 lakh
return "needs_human_approval"
if action["tool"] == "delete_record":
return "block"
return "allow"

The agent can want to do anything. The system decides what actually happens.

What should these checks cover?
Transaction limits: the agent can prepare a payment, but it cannot approve one above its limit. Data access: it can fetch only the records needed for the current task. Tool permissions: a research agent can use search, but it should not get the right to edit financial records by default. Business rules: it cannot skip a required approval step. Sensitive actions: deleting records, changing payment details or sharing confidential files should need extra verification. In our invoice example, a simple rule such as "if the bank account differs from the vendor record, stop and ask a person" would have caught the problem. The key point: these checks must run outside the agent's own thinking.

3. Observability: look beyond the final answer

For normal apps, we track errors, speed and uptime. For agents, that is not enough. If an agent gets something wrong, "the workflow failed" tells you nothing about why. You need to be able to replay the whole run and ask:

  1. What was the agent asked to do?
  2. Which documents did it read?
  3. Which model did it use?
  4. Which tools did it call, and with what inputs?
  5. Was a policy check done, and what was the result?
  6. Did a person approve or reject the action?

A useful trace records each stage of a run:

Many teams build this on top of standard tracing tools such as OpenTelemetry. Good traces also help you find wasted model calls, repeated actions, slow steps and surprise costs. One warning: traces can leak data too. They often hold customer details and internal documents, so mask sensitive fields, limit who can read them, and set clear retention rules.

4. Agent identity: give every agent its own permissions

Picture a company running five agents across finance, HR, sales and support.

  • Should all five reach the same systems?

No. HR needs employee records. Finance needs invoices. Support needs customer history. Giving everyone broad access creates risk for no benefit. This is the principle of least privilege: each agent gets only the access its job needs. In practice, that means:

  1. A separate identity for each agent
  2. A clear owner for each agent
  3. Permissions tied to its tasks
  4. Controlled access to APIs and apps

Credentials that can be rotated and revoked Logs that tie each action to the agent that did it Also decide whether an agent is acting on its own authority or on behalf of a human user. These are different security situations and should not be mixed up.

  1. Multi-agent systems are harder to govern

Things get trickier when agents work together. Imagine a procurement flow with three agents:

  1. A procurement agent collects vendor details A finance agent checks price and budget A compliance agent checks the vendor against company rules They pass work to each other. But what if the first agent gets a detail wrong?
  2. What if the finance agent assumes it was already verified?
  3. What if two agents try to edit the same record?

Controlling each agent one by one can still miss problems in the full workflow. So you need rules at two levels: Agent level:

  • what can each agent see and do?
    Workflow level:

  • how do agents share information, hand over work and finish tasks?

Define clear inputs and outputs for each agent, limit what agents can ask of each other, add approval rules for the whole flow, and keep one record of the entire run. This is still an open area. AWS, for example, has said multi-agent support is on its roadmap for Greenlight, a tool we cover below.

6. The industry is building a control layer for agents

Three announcements in the last two weeks show where things are heading. All three are very new, and the first two are previews, so check the current docs before relying on any of them. The descriptions below come from the vendors' own announcements. Microsoft agent controls (18 November 2026). A managed Azure service, in public preview, for setting and enforcing policies on agent behaviour across frameworks and clouds. It is built on two open-source pieces: Agent Hooks, which define check points in an agent's run (such as input, model calls, tool calls and output), and the Agent Control

Specification, which defines how a decision is made at each point. A check can allow an action, deny it, or change it before it goes ahead. Each decision comes with a receipt showing which policy applied. AWS Greenlight (preview, 1 December 2026). Announced at re: Invent. Teams give it their business rules and supporting material, a language model drafts policies, and automated reasoning (a branch of maths-based logic) checks those rules for conflicts and gaps. Tool calls are then checked against the approved policies before they run. It is deny-by default: an agent has no access to a tool or network destination until it is approved. Enforcement happens outside the agent, so the agent cannot change or skip the rules. Datadog AI Control Plane (30 November 2026). Announced together with new autonomous features for Bits AI. It aims to help teams understand agent behaviour and quality, and to manage risk and cost. The products differ, but they point the same way: autonomy needs visibility and enforceable limits.

7. A practical checklist before you ship an agent

  1. Access and identity
  2. Does the agent have its own identity?
  3. Are its permissions limited to the tools it needs?
  4. Can its access be revoked quickly?
  5. Runtime controls
  6. Are important actions checked before they run?
  7. Are payment and usage limits enforced in code, not just in the prompt?
  8. Do sensitive actions need approval?
  9. Can an unsafe action be blocked without relying on the model?
  10. Observability
  11. Are tool calls and events recorded?
  12. Can you replay a failed run step by step?
  13. Are latency, tokens and cost tracked?
  14. Are sensitive details masked in logs?
  15. Reliability
  16. What happens when a model or API fails?

Can duplicate actions be prevented (for example with idempotency keys)?

  1. Have you tested odd or hostile inputs, including prompt injection?
  2. Is there a way to pause or stop the agent?

Multi-agent coordination

  1. Are each agent's responsibilities clearly separate?
  2. Are agent-to-agent requests controlled?
  3. Can you trace the whole workflow from start to end?

A good demo conversation does not prove an agent is ready. Test the whole system: the tools, the data, the permissions and the environment it runs in.

8. The future is controlled autonomy

For years, the AI debate was about the model: which one is smarter, faster or cheaper? Those questions still matter.

But once agents start doing real business work, four more questions matter just as much:

  1. Can we see what the agent is doing?
  2. Can we control what it is allowed to do?
  3. Can we explain why it did something?
  4. Can we stop it before it causes a problem?

These are not nice-to-have features. They are basic requirements for running agents responsibly. The goal is not to take autonomy away from agents. It is to make that autonomy safe to use. The real win is not an agent that can do everything. It is an agent that knows what it is allowed to do, backed by a system that enforces it.

Where BotIntelli fits in

At BotIntelli, we see this problem every time a company wants to move from an AI demo to real operations. Connecting a few models to a few tools is not enough. Teams need to see what the AI is doing, keep humans in the approval loop where it matters, and have a clear record of every decision.

That is the idea behind our Glass Box AI approach: AI workflows that are explainable and auditable, with approvals, task tracking and evidence built into the process, instead of a black box you have to trust. It is built for regulated industries, where "the agent did it" is not an acceptable answer

If you are planning to put AI agents into real business workflows, we would be glad to compare notes. You can learn more at botintelli.com.

📰 Read the original article on Dev.to AI

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