top of page

Agentic AI: the framework that keeps agents from going rogue

  • Writer: Birgitt Haesen
    Birgitt Haesen
  • Jun 26
  • 6 min read

The problem with AI agents isn't that they do the wrong thing. It's that they do the right thing. Plus a few extra things you never asked for, without a changelog.


This is why so many agentic projects are impressive in a demo and unreliable in production. The gap between the two isn't model quality. It's structure.

Whether you're working with a single agent or a full multi-agent pipeline, the failure mode is the same. Only the scale of the damage differs.


With a single agent, it looks like this: you set up an agent to connect a new ERP source and load the first dataset. It does that. It also notices your three existing ingestion jobs use slightly different field naming, so it standardizes them. Creates two staging tables in a schema you'd never seen. Modifies a scheduling config. Everything runs. Nothing breaks. You just don't know what changed or where.


With multiple agents working in sequence, the same problem compounds. Put ten agents on a platform migration: one profiles source data, one documents business logic, one rebuilds models, one migrates reports, one validates output. Agent 1 labels a field slightly ambiguously. Agent 2 interprets it one way. Agent 3 builds on that interpretation. By Agent 5 you're debugging a cascade that started three steps back, and fixing it means going back to the beginning. The problems don't add linearly. They compound.


The fix isn't a better prompt. It's the structure around the agents.


This diagram shows how a guardrailed agentic system can be structured.
This diagram shows how a guardrailed agentic system can be structured.

1. Start with structured context


Before any agent touches anything, the decisions that matter need to be written down. In files, not prompts. What's in scope, what isn't. Naming conventions. Target architecture. Business logic that's locked versus still under discussion. Coding standards and patterns that apply across the board.


Agents read whatever files they need: some are project-specific, some are shared standards that apply to every project, some are outputs from an earlier stage that the next agent picks up as input. The exact structure depends on how you set things up. What doesn't change is the principle: anything left implicit is a decision the agent makes for itself, possibly differently on each run. Anything important enough to matter is important enough to write down.



2. Use an orchestrator to manage workflow complexity


An orchestrator is a coordinating agent that manages the workflow but doesn't do the work itself. It breaks the project into phases, decides what runs when, and ensures the right context reaches the right agent at the right time.


You don't need multiple specialist agents to benefit from this. Even with a single agent that has access to several skills, a hook, and a validation step, something still needs to decide the order, manage the handoffs, and handle what happens when a step fails. If the agent is managing its own workflow on top of doing the actual work, you've mixed two concerns that are better kept separate. The orchestrator handles the "what next and with what input." The specialist handles the "how."


Where this becomes essential is at scale. When multiple agents work in sequence, the orchestrator is what guarantees Agent 3 is working from the same assumptions as Agent 1, not because they share memory, but because the orchestrator actively distributes the same context to everyone it spawns. Without that, each agent builds its own understanding of the project, and small divergences compound into structural problems by the time anyone catches them.



3. One agent, one job


A specialist agent has a defined scope and nothing outside it. A staging agent builds staging models only. It doesn't validate, document, or improve anything it wasn't asked to build. A report migration agent moves reports. It doesn't touch the underlying data model even if it notices something that looks inconsistent.


This matters for auditability: when each agent has a single responsibility, you can verify each step independently. When one agent does everything, accountability disappears into the middle of its output and you can't tell where a decision was made.

If an agent is producing output it wasn't asked to produce, that's a scope design problem, not behavior to manage after the fact.



4. Skills for fixed, reusable output


A skill is a predefined action with fixed, predictable behavior, implemented as a script rather than agent reasoning. Instead of re-explaining in every prompt how to validate row counts, format a migration log, or profile a data source: you encode that behavior once as a script, and every agent that needs it calls the same one.


The key distinction is between what and how. The agent decides what needs to happen. The script determines how: the exact logic, the output format, the error handling. Take reading a new ERP source: the agent decides which tables are relevant, the script handles how to extract and format them. Same source, same result, every time.


The compounding benefit: skills built for one project become the standard for the next. A validation skill that compares source and target row counts runs identically on migration 1 and migration 5. You stop reinventing the same logic on every initiative.



5. Guardrails before the write


Access control and hooks work at two different levels, and you need both.


Access control defines what an agent is capable of at all. A migration agent gets a read-only connection to the source and write access to the target only. It physically cannot modify the source, no matter what it decides is helpful. An agent generating tests gets read access to the models; no write tool for the model files themselves.


Hooks are automated checks that fire right before an agent uses a tool it does have access to. They validate whether this specific action, in this specific context, is within scope: Is this file going to the right folder? Does it follow the naming convention? Is this table being created in the approved schema? If not, the write is blocked before it happens, not cleaned up after.


Access control means the agent doesn't have a key to the wrong door. A hook is the check on the way in, even for agents that do have a key. Both matter: access control handles the obvious cases, hooks handle the subtle ones.



6. Phase structure, human review, and logging


Structure agentic work in phases, with validation between each. How much of that validation is automated versus human is a design decision, and it depends on the project.


For lower-stakes work with mature automated checks, you can let the pipeline run autonomously and only escalate to a human when something actually deviates from the plan.


For sensitive data, regulated environments, or projects where the business logic is complex and still evolving, you want more human review built into the process, approving the output of each phase before the next one starts, not just on exception.


The principle holds regardless: catching a problem at the phase boundary is always cheaper than catching it three stages later when five agents have built on top of it. What you're deciding is who does the catching: an automated conformance check, a validator agent, a human reviewer, or some combination. The answer should reflect how much is at stake if something slips through.


What makes any of this auditable over time is logging. After every phase, changes get committed to version control and a timestamped entry goes into the decisions log. If something looks wrong later, you can trace what changed, when, and why, without relying on anyone's memory. That's true whether your review process is fully automated or involves a human at every gate.



From rogue to reliable


Production is different from a demo. A prototype can get away with a vague prompt and broad access. Nobody's depending on it. Production means stakeholders relying on the output, pipelines running without anyone watching, audit trails that have to hold up.


The structure in this post is what bridges that gap: consistent input, controlled access, validated output, traceable changes. Not because it makes agents smarter, but because it makes the system around them dependable enough to trust.


There's a broader shift in this too. The data professional who builds and maintains an agentic pipeline is no longer just writing code. They're managing a team of automated workers. Defining who does what, setting the standards they operate by, reviewing output, handling exceptions. The domain expertise stays exactly the same. The role starts to look more like a manager than an individual contributor.


That's the real competitive advantage right now: not the agents themselves, but the ability to run them reliably. And to keep them running as projects grow, teams change, and the stakes get higher.





Comments


bottom of page