Learn · AI Fundamentals

What is context engineering?

Short answer. Context engineering is the practice of deciding what information an AI receives for a task, and in what form, so it can do the work well. It covers instructions, retrieved data, tools, memory and history, and treats leaving things out as just as important as putting them in.

Last reviewed 24 September 2026

From prompts to context

Early advice on using AI focused on prompt engineering: wording a question well. As AI systems gained tools, memory and access to data, the question broadened. The wording of the request matters less than what surrounds it: which documents, which facts, which tools and which history the model has in front of it when it works.

Context engineering is the discipline of designing that surrounding information.

What “context” includes

  • Instructions: what the task is, what good looks like, what to avoid.
  • Retrieved information: documents, records and data relevant to the task.
  • Tools: the actions the AI can take, and descriptions of each.
  • State and memory: decisions made earlier, current status, known facts.
  • History: the conversation or task so far.
  • Constraints: what the AI must not do or reveal.

Why it matters

AI models work with what they are given. With too little context, they guess. With too much, they get distracted, slower and more expensive, and relevant details get lost among irrelevant ones. With the wrong context, such as an out-of-date document, they give confident wrong answers.

In a business, there is a further dimension: some context should never be given at all. The AI helping with Client A must not receive Client B’s files, even if they would technically help.

Principles

  1. Relevant. Include what the task needs.
  2. Current. Prefer live, authoritative data over copied documents.
  3. Structured. Clear records beat pages of loosely formatted text.
  4. Sourced. Tell the AI where each fact came from, so it and the reader can judge reliability.
  5. Bounded. Exclude what the person, or the task, is not entitled to.
  6. Compact. Summarise long histories; do not paste everything.

Context engineering is also access control

In organisations, deciding what goes into an AI’s context is the same decision as deciding what the AI may access. A retrieval system that finds “the most relevant documents” without checking permissions will, sooner or later, put something confidential into the wrong conversation. Context should be filtered by who is asking and for what, before relevance is even considered.

Practical steps

  • Write down, for each common task, what information it needs.
  • Put that information somewhere structured and current.
  • Connect AI to that source rather than uploading copies.
  • Filter by permission first, relevance second.
  • Record decisions so the next task has them.
  • Review failures: when AI gets something wrong, check the context before blaming the model.

How Kroy approaches it

Kroy holds structured entities and organisational state with provenance, and exposes it to AI through projections and Skills. When an AI asks for context, Kroy resolves who is asking and which agent, then returns only what that person, agent and task are permitted to receive. Give AI the context it needs.