What context engineering is.
The term grew out of prompt writing. A prompt is a fixed set of instructions, written once and sent every time. Context is everything the model sees at the moment it makes a decision. For an agent doing real work, that is far more than a prompt: the documents it was given, the records it looked up, earlier conversations with this customer, descriptions of the tools it can use and the results of the steps it has already taken.
Each of those is chosen, by a person or by the system. Context engineering makes the choice on purpose, for each kind of job, instead of leaving it to whatever was easiest to include.
It matters because the model is only one input. The agent lifespan problem makes the point from the other side: once an agent is running, its behavior comes from the whole system around it, including its instructions, the information it retrieves, its memory, its tools and its policies. Change any of them and the agent behaves differently, whether or not anyone touched the model.
Why giving it everything does not work.
The tempting answer is to hand the agent all of it: every manual, the full history and every system. That fails in ways that are easy to predict.
- The rule that matters gets buried. A limit stated once on page forty competes with everything else the agent was given. The more it reads, the easier that one line is to miss.
- Old and new disagree. Last year’s policy and this year’s both say something about refunds. If both are in front of the agent, it has to guess which one wins.
- One customer’s details reach another. Context gathered for one case and carried into the next is how a customer ends up hearing about someone else’s account.
- Every step gets slower. The agent reads its context on every decision it makes. On a phone call, the caller hears that time as silence.
- More tools, more wrong calls. Every tool in reach is one more way to call the wrong system or act outside the workflow.
The opposite habit fails too. Building the knowledge into each agent gives every copy its own version of the rules, and the copies drift apart as the business changes. The agent sprawl trap shows how that multiplies across a company, and What is AI agent sprawl? covers what it costs.
What a job’s context should hold.
Six kinds of context cover most of what an agent needs to do a job well. Each comes from a different place and changes at a different pace, which is why each needs its own owner.
| What it is | Where it comes from | When it changes | |
|---|---|---|---|
| The procedure | The steps for this kind of work, its goal and what counts as done | The approved workflow | When the team approves a new version |
| Business rules | Product terms, eligibility and how amounts are worked out | Policies, manuals and your website | When the business changes them |
| Customer history | Who the customer is, what they asked, what was promised and what is still open | Earlier conversations on every channel | After every conversation |
| Policy limits | What the agent may not do, and the amounts it may not exceed | Rules your team writes | When a policy changes |
| Approvals | Which steps wait for an expert’s sign-off | The workflow and your rules | Rarely, and on purpose |
| Tools | The systems this job may read from and write to | The connections the workflow uses | When the workflow changes |
The test for each item is simple: would a careful new hire need it to do this job today? If not, leave it out. A new hire answering a billing question does not need the scheduling manual open on the desk.
Chosen when the job starts, not built into the agent.
AIOS does not build knowledge into an agent. Procedures, product rules, customer history, policy limits and approval requirements are chosen for the job as it starts, and AIOS records which it used and why. The agent does not need to know everything. It needs to know the right thing at the right time. That is the principle of the right knowledge and tools, when the job starts.
Choosing at the start has practical effects. A change to a rule or a document is there for the next job, instead of waiting to be found and copied into each agent that holds its own version. One core can carry many kinds of work, because each job is handed only its own context: a billing question and a scheduling change can share one core without sharing permissions. And the agent works from what this job needs, instead of searching through what every job might need.
The choice depends on knowing what kind of work has arrived, which is why intent classification comes first. Finding what it needs to know is the second of the five steps every run follows, after understanding what is asked and before planning the steps.
Hand it only the tools the job needs.
Tools are context too. An agent sees a description of each tool it can use and decides which one to call. A tool it was never given is one it cannot call by mistake, so the safest set is the smallest one that gets the job done.
In AIOS a run is handed the systems that job needs and no others, because every extra tool is one more way to call the wrong system or act outside the workflow. The connections themselves are shared. AIOS has ready-made connectors for more than 100 systems, and every workflow reads and writes through the same connections. Narrowing a job’s tools changes what that job may reach, not how your systems are connected.
AI agent guardrails, explained covers the rest of the checks a run should meet, from masking personal data to the kill switch.
Give it the customer’s story, not the whole transcript.
Customer history is the context customers notice. When it is missing, they explain themselves again. When it is wrong, they get an answer meant for someone else’s situation. When it is the full transcript of every past conversation, the agent has to read a long history to find the one promise that matters.
What works is a short account of where things stand, kept current. AIOS customer memory keeps one record per customer across calls, texts, chat, email and collaboration platforms: who they are, what they asked, what was promised and what is still open. A short summary of the customer’s situation is rewritten after every conversation, and open issues and promises stay open until they are resolved.
That record is context your staff can check. People can read exactly what AIOS will know about a customer and correct it, and anything a person entered is never overwritten by AI. When two records look like the same person, AIOS suggests the match and a person confirms it, which keeps one customer’s details out of another customer’s case.
Keep the documents it reads current.
Most business rules live in documents: policies, manuals, price lists and help pages. AIOS answers from your documents and website. You upload policies and manuals, or point it at a site to read. An agent treats what it reads as true, so most of the work is in what you give it.
- One current version of each document. Retire the old one when the new one arrives. Two versions that disagree are worse than one that is slightly out of date.
- An owner for each. Someone who knows when it is wrong and is responsible for fixing it.
- Rules stated as rules. A refund limit written plainly is easier to find and apply than one implied by an example.
- Hard limits written as policy rules too. A limit the agent must never cross belongs in a rule that is checked on every action, as well as in the document that explains it.
Where a step needs a fixed answer and where it needs judgment is a separate question, covered in Rules-based automation vs AI. Documents also miss what your best people know and never wrote down. How to capture tacit knowledge covers getting that into the workflow before anything is automated.
Record what it was given.
When a run goes wrong, the first question is whether the agent had the wrong context or did the wrong thing with the right context. The fixes are different. Wrong context means changing a document, a rule or what the job is given. A wrong decision made with the right context means changing the workflow or its checks. Without a record of what the agent was given, you cannot tell which one you are looking at.
AIOS records which knowledge each job used and why. Every action, input and output is also written to an append-only audit ledger, so months later you can reconstruct exactly what ran, on whose authority, and why. How to audit an AI agent covers what an auditor will ask of that record.
Context that improves with every run.
Context also has to keep up with the work. After each run, AIOS records what helped, what failed and what resolved the issue, and before the next plan it recalls the lessons that apply. Lessons go into the context each run receives, not into a new agent, and no model is retrained on your data. We call it Agentic Context Evolution.
How self-improving AI agents work covers how those lessons are kept, scored and pruned, and how your team stays in charge of them.
Questions.
What is context engineering for AI agents?
Choosing what an AI agent is given for each job: the procedure, the business rules, the customer’s history, the policy limits, the approvals required and the tools it may use. The aim is the right information for this job, not all of it.
How is context engineering different from prompt engineering?
Prompt engineering writes the fixed instructions an agent is sent every time. Context engineering decides everything else it sees when it makes a decision, such as documents, records, customer history and tools, and chooses them for each job.
Should an AI agent have access to all of our systems?
No. Each job should be handed only the systems it needs. In AIOS a run gets those systems and no others, and every action is checked against your policies before it reaches a system of record.
Is our data used to train the model?
Not in AIOS. No model is retrained on your data. Knowledge is chosen for each job as it starts, and your team can edit or retire any lesson AIOS keeps from earlier runs.
Can we see what the agent knew when it made a decision?
Yes. AIOS records which knowledge each job used and why, and the audit ledger records every action, input and output.
What happens when one of our policies changes?
Update the document or the rule. Because AIOS chooses knowledge for each job as it starts instead of building it into an agent, there is no agent to rebuild and no model to retrain. A limit written as a rule is checked in code on every action, the same way every time.