Summarize in:
Get an instant AI summary of this article

Listen To Our Podcast🎧

Context Engineering for AI Agents in Regulated Work
• 1:58
Context Engineering for AI Agents in Regulated Work
Secure. Automate. – The FluxForce Podcast

What will you learn?

Give an agent too little context and it guesses. Give it too much and it leaks.

Context engineering is the work of deciding what an AI agent sees at each step: which instructions, records, tool results and memory go into the model's context window, in what form, and what stays out. Anthropic defines it as "the set of strategies for curating and maintaining the optimal set of tokens (information) during LLM inference." In regulated work there's a second question on top of that one. Some data helps the agent and is still not allowed in front of it.

This guide is for CTOs building agents that handle customer, supplier or case data, starting with what to give an agent and what to keep out, by data type. Last updated 1 December 2026.

In This Article, You'll Learn
  • What context engineering means, where the term came from and why it replaced prompt engineering in most agent work.
  • A table of what to give an agent and what to keep out, by data type, with the rule behind each row.
  • How context engineering differs from prompt engineering and from RAG.
  • Why a bigger context window makes many agents worse, and what the research measured.
  • What regulators expect you to record, and where a person makes the call.

Request the data type table

Bring one agent you're building or buying and the data sources it can reach, and we'll walk the table with you row by row.
Get the what to give an agent and what to keep out, by data type
What to give an agent and what to keep out, by data type: give, reduce and keep out columns with a reviewer sign-off.

Four questions for every data source

Ask them before a source is connected to an agent.

  1. Does the task need this data at all?
  2. Could a masked or summarised form do the job?
  3. Does any law bar this agent from seeing it?
  4. Who can see what the agent saw later?
"
Direct answer

Context engineering is deciding what an AI agent sees at each step, including instructions, records, tool results and memory, in what form, and what stays out; in regulated work it also applies the legal rule for each data type.

What is context engineering?

In IBM's words, language models "generate responses solely based on the context window they have access to at inference time." That makes the context the agent's whole working world.

The term started to gain traction in June 2025, when Shopify's CEO Tobi Lütke and Andrej Karpathy both backed it publicly. Karpathy called it "the delicate art and science of filling the context window with just the right information for the next step." Anthropic calls it "the natural progression of prompt engineering." Gartner's definition stresses the business side, "designing and structuring the relevant data, workflows and environment so AI systems can understand intent, make better decisions and deliver contextual, enterprise-aligned outcomes."

An agent makes this harder than a chatbot does. It rebuilds its context on every step, tool output lands in the window, and it may keep memory across sessions, so the wrong data has more ways in.

We call the principle behind this context before decision. The agent assembles the right, bounded picture of a customer, supplier or case before anyone weighs it, and a person makes the call on the prepared case. Our context graph guide explains where that picture comes from.

What to give an agent and what to keep out, by data type

Most context engineering advice is about quality. In regulated work you also need a rule per data type, because privacy, secrecy and competition law decide some rows before quality does. GDPR requires personal data to be "adequate, relevant and limited to what is necessary in relation to the purposes for which they are processed." The FTC's Safeguards Rule tells the financial institutions it covers to limit users' access "only to customer information that they need to perform their duties and functions."

Context engineering by data type: source records pass a data type check that sends task fields to the agent context, card numbers and identifiers to reduced form, and credentials, card security codes and suspicious activity report status to kept out, and the reviewer decides on the prepared case.
  • The source records go through a data type check before anything reaches the agent. The data type check sends task fields to the agent context in full. The data type check sends identifiers and card numbers to reduced form, masked or tokenised. The reduced form then joins the agent context. The data type check sends credentials, card security codes and suspicious activity report status to kept out, where no prompt can reach them. The agent context produces a prepared case, and the reviewer decides.
Sort each data type before it reaches the agent; a person decides on the prepared case.

Treat the table as a default; your legal team sets the final rule per market.

Data type Rule What the agent sees Why
Policy, procedure and risk method Give The current approved version, in full The agent can't apply a rule it can't see
Customer identity and due diligence record Give in part Only the fields the task needs Data minimisation and access limits
Transaction history Give in part A dated window and a summary, not every row Long inputs reduce accuracy
Special category data (health, religion, ethnicity, biometrics) Keep out Nothing, unless a lawful exception applies and the task needs it GDPR Article 9 and UK automated decision rules
Card numbers Give in reduced form Masked or tokenised number only Limits what a leak exposes
Card security codes, PINs, track data Keep out Nothing, including transcripts and logs PCI DSS bans storing them after authorization
Passwords, API keys, tokens Keep out Nothing; the tool holds the secret A prompt can't leak what it never held
Suspicious activity report status and drafts Keep out of every agent outside the filing team Nothing SAR confidentiality and tipping-off law
Supplier bids and pricing Give in part Only the bid under review, never a rival's price Tender confidentiality and competition law
Untrusted outside content (emails, web pages, supplier files) Give, labelled Marked as untrusted, in a session that can't send data out Prompt injection
Past decisions and their reasons Give The decision, the reason, the date and who made it Consistency with precedent
Another customer's or team's records Keep out Nothing; stores are partitioned Retrieval can leak across user groups

The first figure shows how a record gets sorted. The source records go through a data type check before anything reaches the agent. The data type check sends task fields to the agent context in full. The data type check sends identifiers and card numbers to reduced form, masked or tokenised. The reduced form then joins the agent context. The data type check sends credentials, card security codes and suspicious activity report status to kept out, where no prompt can reach them. The agent context produces a prepared case, and the reviewer decides.

Sort every source by data type before it reaches the agent. A rule written in the prompt can be argued around, but a field the agent never received can't leak.

Special category data is banned by default. GDPR Article 9(1) says processing data about racial or ethnic origin, religion, health, biometrics and similar categories "shall be prohibited" unless an exception applies. Since 5 February 2026, UK law has said a significant decision based on that data "may not be taken based solely on automated processing" outside narrow conditions.

Card security data has a hard rule. The PCI Security Standards Council says "PCI DSS Requirement 3.3.1 prohibits storage of SAD after authorization, even if encrypted." The Council's guidance says keeping card codes "in any form of digital audio recording" after authorization breaks that rule, so redact them before a call recording or its transcript reaches an agent.

Suspicious activity reports are the row teams miss. US rules say "A SAR, and any information that would reveal the existence of a SAR, are confidential." The FATF says staff should be prohibited by law from disclosing "the fact that a suspicious transaction report (STR) or related information is being filed with the FIU." A customer service agent that can read case notes can tip off a customer by accident.

Don't rely on instructions to keep data private. OWASP warns that system prompt rules against revealing data "may not always be honored and could be bypassed via prompt injection or other methods." If data must not leak, keep it out of the window.

Context engineering for agents

LangChain sorts the techniques into four groups. Writing saves context outside the window, selecting pulls it in, compressing keeps "only the tokens required to perform a task," and isolating splits work across separate contexts.

Context engineering for agents: write moves notes from the context window to a memory store, select pulls records through a retriever, compress turns the window into a summary, and isolate hands a task to a sub-agent that returns a short result.
  • Write moves notes from the context window to a memory store outside it. Select uses a retriever to pull only the records the next step needs into the context window. Compress turns a long context window into a summary that keeps the decisions and drops the noise. Isolate hands a narrow task from the context window to a sub-agent with its own clean window. The sub-agent returns a short result to the main context window.
Write, select, compress and isolate, all around one context window.

The second figure shows how they fit together. Write moves notes from the context window to a memory store outside it. Select uses a retriever to pull only the records the next step needs into the context window. Compress turns a long context window into a summary that keeps the decisions and drops the noise. Isolate hands a narrow task from the context window to a sub-agent with its own clean window. The sub-agent returns a short result to the main context window.

Google designed its Agent Development Kit around the same rule. "Every model call and sub-agent sees the minimum context required," and agents must reach for more through tools, "rather than being flooded by default."

Manus found that "any irreversible compression carries risk," because you can't tell which detail will matter ten steps later, so it drops a page's content but keeps its URL. A reviewer can follow that pointer back to the source.

Memory needs its own controls. Anthropic's memory tool documentation tells developers to add validation "that strips sensitive data before your handler writes the file."

Why more context makes agents worse

A bigger window doesn't fix bad context. Chroma tested 18 models in 2025 and found "their performance grows increasingly unreliable as input length grows." On one memory task, every model scored much higher on a focused prompt of about 300 tokens than on the full input of about 113,000.

The older research points the same way. The 2023 Lost in the Middle study found models use information best at the start or end of the input and worst in the middle. NVIDIA's 2024 RULER benchmark found that of models claiming 32,000-token windows or more, "only half of them can maintain satisfactory performance at the length of 32K." And in the NoLiMa benchmark, GPT-4o fell "from an almost-perfect baseline of 99.3% to 69.7%" at 32,000 tokens when the answer didn't share words with the question.

Bury a customer's one relevant fact among 300 transactions and a risk agent may miss it, so two similar customers get different treatment.

Context engineering vs prompt engineering

Prompt engineering is writing good instructions. Microsoft's agent course describes it as "a single set of static instructions," while context engineering manages "a dynamic set of information, including the initial prompt."

Ownership changes too. A prompt is one engineer's text, but an agent's context comes from pipelines, tools, retrieval and memory, so it's an architecture decision for the CTO, the data owner and compliance together.

Context engineering vs RAG

Retrieval-augmented generation is one way to fill the window. The original 2020 paper described models "which combine pre-trained parametric and non-parametric memory for language generation." IBM notes that RAG "doesn't address the system prompts, how message history is managed and how information from other tools is incorporated into the context."

Prompt engineering RAG Context engineering
What it decides The wording of instructions Which documents to fetch Everything the model sees at each step
When it runs Written once, revised by hand On each query On every step of an agent run
Typical failure Vague instructions Wrong or stale passages Leaks, overload, poisoned memory

RAG also brings risk with it. OWASP says retrieval and fine-tuning "do not fully mitigate prompt injection vulnerabilities." Its entry on vector and embedding weaknesses warns that when several user groups share one vector database, "there's a risk of context leakage between users or queries," and recommends "permission-aware vector and embedding stores." In a bank, a relationship manager's agent mustn't retrieve another team's case notes just because they look similar.

When context becomes an attack path

Every document an agent reads can carry instructions. The UK's National Cyber Security Centre says current models "simply do not enforce a security boundary between instructions and data inside a prompt," and that prompt injection may never be fully fixed the way SQL injection can.

An agent session that receives untrusted content and private data has no direct path to outside communication; a person approves the next step when a task needs all three.
  • Untrusted content enters the agent session from emails, web pages and supplier files. Private data enters the agent session from your own systems. An agent session that holds both should have no path to outside communication without a person in between. When a task needs all three, the agent session stops and a person approves the next step.
Untrusted content plus private data in one session means a person stands before anything goes out.

EchoLeak, CVE-2025-32711, was an "Ai command injection in M365 Copilot" that let an outside attacker "disclose information over a network."

The practical answer is to limit what one agent session can combine. Meta's Agents Rule of Two says agents "must satisfy no more than two of the following three properties within a session," meaning untrusted input, access to private data and the ability to change state or communicate outside.

The third figure shows the rule. Untrusted content enters the agent session from emails, web pages and supplier files. Private data enters the agent session from your own systems. An agent session that holds both should have no path to outside communication without a person in between. When a task needs all three, the agent session stops and a person approves the next step.

The NCSC adds two controls. Use "deterministic (non-LLM) safeguards that constrain the actions of the system," and log "full input and output of the LLM, as well as tool use, API calls etc." OWASP's entry on excessive agency says to "Implement authorization in downstream systems rather than relying on an LLM to decide if an action is allowed or not."

Who owns which part of the context

Data owners set the rules; the agent works inside them; a person decides.

ComponentResponsibilityBoundary
Data ownerSets the rule for each data type.Legal signs off per market.
AgentPrepares the case from its bounded context.Never decides or sends on its own.
ReviewerDecides and records why.Sees what the agent saw.

A named person decides on every prepared case; the agent recommends and never decides on its own.

Context engineering in procurement

Procurement is a good test, because a supplier evaluation agent sees bids, prices, bank details, ownership records and contract terms.

Bids carry legal weight. EU public buyers must not disclose what suppliers mark confidential, including "technical or trade secrets and the confidential aspects of tenders." The European Commission's competition guidelines treat information on "costs, capacity, production, quantities, market shares, customers" and strategy as commercially sensitive. So an agent scoring one bid shouldn't hold a rival's pricing in the same context, and a shared agent across business units needs separated stores.

Data quality is the other half. Gartner said in 2025 that "fragmented and low-quality data across procurement systems can hinder accurate outputs" for generative AI in procurement. In 2024 it also advised buyers to "Incorporate data privacy standards as key criteria in supplier evaluations." Our vendor due diligence guide shows what a supplier file should contain before an agent sees it.

Illustrative scenario: a supplier scoring agent

Illustrative scenario, not a customer result.

This case is made up to show the method. A buyer runs an agent that scores bids in a tender with three suppliers.

  1. The agent gets one bid at a time, never the others.
  2. Bank details arrive masked; the payment team holds them.
  3. Supplier files are marked untrusted; the session cannot email out.
  4. The buyer reviews the scores and decides.

What regulators expect you to record

In the EU, the AI Act's data, logging and human oversight duties for high-risk systems now apply from 2 December 2027 for Annex III systems, after the 2026 Digital Omnibus delay. When they apply, a deployer that controls input data must ensure it "is relevant and sufficiently representative in view of the intended purpose," and must keep the system's logs for "at least six months."

The Monetary Authority of Singapore published its final AI risk management guidelines in October 2026. Its response to feedback says monitoring of agentic AI should extend to "information flows and decision-making paths across workflows that use AI, such as reasoning processes, actions taken, and tools used." The UK ICO's draft guidance on automated decisions says to "keep a record of how the human was involved in the decision," and that spot-checking alone isn't enough.

In the Bank of England and FCA survey published in October 2026, 80% of respondents had agents in production providing decision support, where "AI agents recommend actions, humans decide and execute," and only 2% deployed agents with broad autonomy.

Read together, these point to one record. Keep what the agent saw, which tools it called, what it recommended and who decided. Our guide to decision traces covers what to store.

How FluxForce approaches context before decision

FluxForce is the platform your departments run AI agents on. The agents investigate and prepare the work, a person makes the call, and every step leaves evidence an examiner can replay.

Five public stages of the FluxForce platform: take in passes the source records to understand, understand passes one bounded view of the customer or supplier to weigh, weigh passes the recommendation and its reasons to prove, and prove passes the evidence record to report and learn, with governance controls and data protection on every step.
  • Take in passes the source records to understand. Understand passes one bounded view of the customer or supplier to weigh. Weigh passes the recommendation and its reasons to prove. Prove passes the evidence record to report and learn.
Take in, understand, weigh, prove, report and learn, with governance controls on every step.

The platform works in five public stages, take in, understand, weigh, prove, and report and learn, with governance controls and data protection on every step. The fourth figure shows the order. Take in passes the source records to understand. Understand passes one bounded view of the customer or supplier to weigh. Weigh passes the recommendation and its reasons to prove. Prove passes the evidence record to report and learn.

Context before decision happens in understand. The data type rules in the table above apply there, before anything is weighed, and prove keeps what the agent saw in tamper-evident form.

The closest of our solutions here is Customer Risk Assessment. A US bank's AML programme must include "Understanding the nature and purpose of customer relationships for the purpose of developing a customer risk profile." Building that profile is a context problem. On our solution page, the agent "Uses the risk factors and weights in your policy," and "Each rating lists the factors that drove it." Its page says "Upgrades to High go to a person for sign-off" and "Any rating can be replayed as it stood on a given date." See how Customer Risk Assessment works.

On fit, our first app line is financial crime and compliance. AI agents that investigate AML, sanctions, fraud and KYC alerts and prepare the case. Your analyst makes the call, with evidence an examiner can replay. You decide how much each agent does on its own, and every one has a kill switch. Procurement agents run on the same platform in the same pattern, and we can't point you to customer results for them yet. Your data rules, risk method and approvers stay yours.

How to start

  1. Pick one agent you're building or buying.
  2. Sort every data source it can reach with the table above. Any source nobody can classify is your first data project.
  3. Run the agent in shadow mode for a quarter, preparing work beside your team and changing nothing, and record what it saw on each case.
  4. Compare its prepared cases with your reviewers' decisions. Every decision stays with a person.

Agentic AI and real-time decisioning explains why hand-offs break at speed, and the AI agents directory shows the agents on the platform.

Primary sources behind the data type table

GDPR Articles 5, 9 and 25

Data minimisation and the special category ban.

EU regulation, in force.

2026-12-01

31 CFR 1020.320(e)

SAR confidentiality, including its existence.

US banks, current eCFR.

2026-12-01

OWASP LLM02:2025

Prompt rules can be bypassed; keep data out.

Industry standard list, 2025 edition.

2026-12-01

Where Customer Risk Assessment fits

Customer Risk Assessment applies the risk factors and weights in your policy and shows which factors drove each rating.

See how Customer Risk Assessment works

It is built for customer ratings; your data rules, method and approvers stay yours. No customer results to quote yet.

A first context engineering test

  1. Sort one agent's data sources with the table.
  2. Name an owner for each source.
  3. Run the agent in shadow mode for a quarter.
MetricDefinitionDecision guardrail
Reviewer change rateShare of prepared cases a reviewer changes.A rising rate pauses wider use.
Key takeaways
  • Set a rule for each data type before connecting it.
  • Keep out what must not leak; prompts are not a control.
  • Smaller, focused context beats a bigger window.
  • Untrusted content and private data need a person before anything goes out.
  • Record what the agent saw; a person makes the call.

Conclusion

Context engineering decides what an agent knows when it prepares a case, and so what a reviewer ends up judging. In regulated work the data type rule comes before any quality tuning. Give the task what it needs, pass identifiers and card numbers in reduced form, and keep credentials, SAR status and rival bids out of the window entirely. Then keep a record of what the agent saw, so the person who decides can show why.

Request the data type table

Bring one agent you're building or buying and the data sources it can reach, and we'll walk the table with you row by row.
Get the what to give an agent and what to keep out, by data type
What to give an agent and what to keep out, by data type: give, reduce and keep out columns with a reviewer sign-off.

Frequently Asked Questions

Context engineering is deciding what an AI model sees at each step, including instructions, records, tool output and memory, and what stays out. Anthropic describes it as curating "the optimal set of tokens (information) during LLM inference."

About the author

Sahil Kataria, Founder and CEO of FluxForce

Sahil Kataria

Founder and CEO of FluxForce

Sahil works on secure AI and financial technology for regulated industries. His engineering background spans identity verification, payment security and compliance automation. He has led teams across Africa, the United States, Europe and India.

At FluxForce.ai, his focus is on explainable AI and auditable financial workflows. He writes for banking and compliance teams about the practical decisions behind these systems: how to assess risk, keep controls visible and introduce automation without losing accountability.

View Sahil Kataria author profile →

Enjoyed this article?

Subscribe now to get the latest insights straight to your inbox.

Recent Articles