Prompts are not architecture. Before an agent touches a customer, a database, or an API, it needs a production-grade Agent Spec.
By Ashu Kumar
Published: 2026-05-19
URL: https://theagenticstack.substack.com/p/your-ai-agent-needs-a-spec-not-a

Most AI agents begin life as a prompt.
A system message. A few tools. A memory layer. Maybe a workflow graph. Then someone says: “Let’s put this in front of users.”
Thanks for reading The Agentic Stack! Subscribe for free to receive new posts and support my work.
That is where the trouble starts.
Because a prompt tells the model how to behave. But a spec tells the system how to survive production.
A prompt might say:
You are a helpful customer support agent. Resolve the customer’s issue politely and efficiently.
An Agent Spec asks:
- What is this agent allowed to do?
- What is it forbidden from doing?
- Which tools can it call?
- What happens when tools fail?
- When should it escalate to a human?
- What memory can it access?
- What should be logged?
- How do we evaluate success?
- How do we stop it when it goes wrong?
That is the difference between a demo and a production system.
A demo needs a prompt. A production agent needs a spec.
The prompt is the most visible part of the system, not the most important
The industry still treats prompts like the center of the agentic universe.
We optimise them. Version them. Debate them. Chain them. Wrap them in frameworks.
But in real production systems, the prompt is only one component.
The harder problems are not usually prompt problems. They are boundary problems.
The agent did not fail because the prompt used the wrong adjective. It failed because nobody defined the agent’s operating boundary.
For example:
- The refund agent approved a refund it was not authorized to approve.
- The research agent cited a stale document because retrieval boundaries were unclear.
- The sales agent promised a feature the product team had not committed to.
- The DevOps agent retried a failed operation until it created an outage.
- The finance agent exposed sensitive data because tool permissions were too broad.
None of these are solved by asking the model to “be careful.”
Production agents need constraints that exist outside the model’s good intentions.
That starts with an Agent Spec.
What is an Agent Spec?
An Agent Spec is the production contract for an AI agent.
It defines what the agent is, what it can do, what it cannot do, what systems it can touch, when it must ask for help, and how its behavior will be measured.
Think of it as a combination of:
- Product requirements document
- API contract
- Security policy
- Runbook
- Evaluation plan
- Observability checklist
For traditional software, we do not ship serious systems with only a function name and a comment.
But for AI agents, we often ship something dangerously close to that:
You are an autonomous operations assistant. Use the available tools to solve the task.
That is not a system design.
That is a liability with a friendly tone.
The 10 sections every Agent Spec needs
A production-grade Agent Spec should define at least ten things.
1. Mission
What is the agent’s job?
Not in vague terms. In operational terms.
Bad:
Help users with billing.
Better:
Resolve tier-1 billing questions by retrieving invoice status, explaining charges, and creating support tickets when user approval or account modification is required.
The mission should make clear what the agent owns and what it does not own.
If the mission is too broad, the agent becomes a “God Model” with a tool belt.
That is how demos become incidents.
2. User and environment
Who is the agent serving?
A customer? An internal employee? A support rep? A developer? Another agent?
The environment matters because the same behavior can be safe in one context and dangerous in another.
An internal research agent summarizing documents is very different from a customer-facing legal assistant. A sales assistant drafting an email is different from an agent that can send the email automatically. A code review agent commenting on a pull request is different from one that can merge the pull request.
The Agent Spec should define the operating environment clearly.
3. Autonomy level
This is one of the most important sections.
How much freedom does the agent have?
I like to think in five levels:
Level 0: Suggest only The agent can recommend an action, but a human must execute it.
Level 1: Draft for approval The agent can prepare an action, but a human must approve it.
Level 2: Execute low-risk actions The agent can perform reversible or low-impact actions.
Level 3: Execute with guardrails The agent can perform meaningful actions, but within strict policy, budget, and permission limits.
Level 4: Autonomous operation The agent can plan and execute independently, with monitoring and emergency stop controls.
Most teams jump from Level 0 to Level 4 in their imagination.
Production systems should usually move one level at a time.
If your Agent Spec does not define autonomy level, your production environment will define it for you — usually during an incident.
4. Tool contract
Every tool an agent can call should have a contract.
Not just the API schema.
The actual operating contract.
For each tool, define:
- What the tool does
- What data it can access
- What permissions it requires
- Whether the action is read-only or write-capable
- Whether the action is reversible
- What the rate limits are
- What errors can occur
- What the agent should do when the tool fails
The most dangerous tools are not always the most complex ones.
A simple send\email tool can cause brand damage. A simple update\status tool can corrupt a workflow. A simple delete\_record tool can become a production incident.
Do not give agents tools casually.
Tools are not plugins. Tools are permissions.
5. Memory policy
Memory is where many agent systems quietly become unsafe.
The Agent Spec should define:
- What the agent is allowed to remember
- What it must forget
- What memory is user-scoped
- What memory is tenant-scoped
- What memory is global
- How stale memory is detected
- How memory can be deleted or corrected
Without a memory policy, agents accumulate context like a messy shared drive.
Eventually, they retrieve something they should not retrieve, reuse something that is no longer true, or mix context across users.
A production agent does not just need memory.
It needs memory hygiene.
6. Human escalation policy
Every serious agent needs an escalation path.
The question is not whether the agent will get stuck.
It will.
The question is what it does next.
A good Agent Spec defines escalation triggers:
- Low confidence
- Missing information
- Conflicting instructions
- High-value transaction
- Policy-sensitive request
- User frustration
- Tool failure
- Repeated retries
- Security or compliance risk
Escalation should not be treated as failure.
Escalation is part of the architecture.
In many production systems, the safest agent is not the one that answers everything. It is the one that knows when to stop.
7. Evaluation plan
You cannot manage an agent you do not evaluate.
The Agent Spec should define how success is measured before launch.
That includes:
- Task completion rate
- Accuracy
- Hallucination rate
- Escalation quality
- Tool-call correctness
- Latency
- Cost per task
- User satisfaction
- Policy violations
- Regression tests
The trap is relying only on vibes.
“This answer looks good” is not an evaluation strategy.
For production agents, you need golden datasets, adversarial tests, tool-call checks, and human review loops.
The evaluation plan should be part of the spec, not an afterthought added after the first customer complaint.
8. Observability plan
Traditional software observability asks:
What happened inside the system?
Agent observability has to ask more:
What did the agent believe?
What context did it see?
What tools did it call?
What did it ignore?
Why did it escalate?
Where did the cost come from?
A production Agent Spec should define what gets logged:
- User request
- Retrieved context
- Prompt version
- Model version
- Tool calls
- Tool responses
- Intermediate decisions
- Final answer
- Token usage
- Cost
- Latency
- Escalation reason
- Policy flags
If your agent fails and you cannot reconstruct the path, you do not have observability.
You have a transcript and a prayer.
9. Cost boundary
Every agent needs a budget.
Not just a cloud budget. A task-level budget.
The Agent Spec should define:
- Maximum tokens per task
- Maximum tool calls per task
- Maximum retries
- Maximum execution time
- Model routing rules
- Cache policy
- Escalation threshold when cost exceeds value
Without a cost boundary, agents optimize for completion at any price.
That might be acceptable for a demo.
It is not acceptable for production.
A $0.20 task that costs $4.00 to complete is not intelligence. It is bad unit economics with a chat interface.
10. Shutdown and rollback policy
The final section is the one most teams avoid.
How do you stop the agent?
The spec should define:
- Who can pause the agent
- What automatically pauses the agent
- Which actions can be rolled back
- Which actions require manual review
- What happens to in-flight tasks
- How users are notified
- How the team investigates the incident
- How the agent is re-enabled
If an agent can act, it must be possible to stop it.
Autonomy without shutdown control is not innovation.
It is negligence.
The Agent Spec is where product, engineering, security, and operations meet
The most useful thing about an Agent Spec is not the document itself.
It is the conversation it forces.
Product has to define the job. Engineering has to define the system boundary. Security has to define permissions. Legal and compliance have to define risk zones. Operations has to define monitoring and escalation. Leadership has to define acceptable autonomy.
That conversation is the real architecture.
The spec simply captures it before the model starts improvising in production.
A simple rule
Before you ship an AI agent, ask this:
If this agent fails at 2 a.m., can we explain what happened, stop the damage, and improve the system?
If the answer is no, the agent is not production-ready.
It may be impressive. It may be useful. It may even work most of the time.
But it is not production-ready.
Because production is not about the happy path.
Production is about what happens when the model is confused, the tool fails, the context is stale, the user is angry, the API is slow, the policy is ambiguous, and the business still expects the system to behave.
That is why your AI agent needs a spec.
Not just a prompt.
Discussion prompt
What is the one section your team currently defines best: tools, memory, evals, observability, escalation, or cost?
And which one is still mostly undocumented?
🚀 Apply for the [Flurit.ai Early Adopter Design Program to test the Shadow Swarm in your environment]
Thanks for reading The Agentic Stack! Subscribe for free to receive new posts and support my work.