How much context to give an AI agent without oversharing

Relevant context can improve an agent’s decisions, but extra material can also distract it or reveal something a public output should omit. I sort each fact into one of four classes. Before anything goes public, I keep the reasoning, constraints and proof, and remove secrets, private history and anything that identifies people or projects.

Layered ivory paper screens with a single square opening revealing the view beyond
Illustration: layered ivory paper screens with a single square opening revealing the view beyond.

Agent work has a real tension. The right context can improve a decision; unnecessary context adds disclosure risk, stale facts and distraction. Starving the agent fails, and so does pasting a whole working history into every prompt. I give each audience the minimum sufficient context for its job.

Two questions often get mixed together, and I keep them apart. The first is what does the agent need to complete the work? The second is what can safely appear in the published output? The first answer can stay narrow and private, while the second has to hold up in front of any reader.

Choose the audience first

Whether a piece of context is safe depends on who will read it and why. A temporary task packet, a project rule file and a public article have different readers, different lifetimes and different disclosure limits.

My default is to treat every generated page, screenshot, report, preview and copied prompt as potentially shareable. That changes the editing question from “is this secret?” to “does the reader need this?”

Sort context into four classes

Classifying each fact makes the decision mechanical. Every fact belongs to one of four classes:

The four classes of context, what belongs in each and how each is treated in public output.
ClassWhat belongs herePublic treatment
PublicPublished interfaces, documented behaviour, public methodsUse when relevant and current
Project-internalUnreleased plans, internal routes, operational historyAbstract the method; remove the identifiers
SecretCredentials, tokens, private keys, protected endpointsNever copy, paraphrase, or expose
PersonalContact details, private schedules, addresses, private conversationsRemove unless explicitly authorised for that audience

The line that matters most runs between project-internal and secret. Internal context can often be turned into a public method that someone else can apply, and a secret never can. “Verify every consumer of a changed asset” keeps the lesson; the internal asset name and deployment history add nothing for a public reader.

Use minimum sufficient context

The best prompt is the smallest packet that lets the agent make the right decision without guessing. For most implementation work, that packet has five parts:

  1. Outcome: the observable state that should be true when the work is done.
  2. Scope: the files, routes or surfaces the task may touch.
  3. Constraints: the facts and behaviours that must not change.
  4. Evidence: the checks that can prove the outcome.
  5. Stops: the conditions that require a report instead of improvisation.

A public, reusable version of this packet can usually omit identifying details. An authorised execution packet may need an exact hostname, path, source record or recipient to act on the right target. Supply only those necessary details through the approved context, and keep them out of public examples unless that audience is authorised to receive them.

Turn a private note into a public pattern

When a lesson comes from private work, I rewrite it before publishing. I strip out the nouns that identify the project and keep the verbs that explain the method.

The same lesson, before and after
WORKING NOTE
Change <internal surface>, then verify <named consumers> and
the protected production response.

PUBLIC PATTERN
When a shared asset changes, inventory every consumer, rebuild,
verify the rendered output, and compare the deployed response.

The public version keeps the sequence, the blast-radius rule and both checks: the rendered output and the deployed response. It is still specific enough to follow, and drops only the facts that would not help a public reader apply the method.

Noun and verb test. Circle the proper nouns, exact identifiers, contact details, paths and private numbers. Delete or generalise them. Then check whether the verbs still teach a complete workflow. If they do, the public version still carries the method.

Write a public-safe task packet

A reusable task packet can be detailed without identifying the project or anyone in it. It gives the agent its authority and the checks to run, and keeps private facts behind placeholders or references to the approved source.

Public-safe task packet
AUDIENCE
This output is public.

OUTCOME
Describe the observable result without naming a private project.

SCOPE
List only the allowed public files or generic surface types.

SOURCE OF TRUTH
Use the approved source supplied for this run. Do not restate
protected values in the output.

EXCLUSIONS
No names, contact details, credentials, local paths, private URLs,
private metrics, copied conversations, or unreleased plans.

EVIDENCE
Build, link check, responsive browser pass, and deployed preview.

STOP IF
The result requires an excluded fact or the source of truth conflicts.

The source can still hold the detail the task needs. The packet makes clear that the output must not reproduce it.

Separate the context layers

One giant context file eventually contradicts itself and cannot be shared safely. I use four layers, each with a clear owner:

  • Public rules: design language, generic build commands, accessibility standards and public editorial principles.
  • Private facts: protected values and internal operational facts, loaded only when the task requires them.
  • Task packet: the temporary outcome, scope, checks and stop conditions for one run.
  • Public output: the final page, report or example after the disclosure pass.

Each fact should have one owner. Public rules should not duplicate private facts that change, and published pages should not become accidental storage for temporary operational context.

Treat an assistant’s system prompt as if it will become public. System prompts leak often enough that public archives collect them; the largest, CL4R1T4S, is covered in the Pliny the Liberator guide. Keys, internal addresses and private pricing belong in the private-facts layer, outside the prompt.

Run the disclosure gate

Before a public build or preview, I scan both the source and the rendered result. Automated checks catch obvious patterns, and a human review catches meaning.

Seven questions before publishing

  1. Does the page name a private organisation, project, product, or person?
  2. Does it contain an email address, phone number, location detail, or private schedule?
  3. Does it expose a local path, protected route, credential, token, or configuration value?
  4. Does an example preserve a private number or internal metric that could be generalised?
  5. Does a screenshot reveal tabs, accounts, notifications, filenames, or browser history?
  6. Does the public lesson remain complete after those details are removed?
  7. Did the rendered preview and machine-readable metadata receive the same review?

A clean paragraph can sit beside revealing structured data, social metadata, filenames or generated navigation. So the review covers everything that ships with the page: the markup, the metadata and the filenames as well as the prose.

Oversharing and over-redaction

Oversharing copies the whole working context into the output and hopes the reader ignores it. Over-redaction removes so much meaning that the lesson shrinks to “be careful”, with no method left to apply.

Between the two, I publish the decision structure, the repeatable sequence, the constraints and the checks. I remove the identity, access details, protected values and private history.

A public-safe workflow passes when someone outside the original project can use it without learning anything they were not meant to know.

Private AI: trace the whole data flow

For a private AI workflow, I want to know which data each component receives, where it is processed and what remains after the run. Running the model locally answers one of those questions. A separate document parser, search tool or synced conversation history can introduce another destination.

LM Studio's offline guide says downloaded models, document chat and its local server can work without internet access. Model discovery, downloads and update checks use connectivity. Ollama's FAQ describes a local-only setting that disables its cloud models and web search. Those are documented application behaviours, checked on 31 October 2026; they do not verify every client or tool connected to either runner.

Record each destination before using private material.
StageWhat to establish
Input and extractionWhich files enter the workflow, and whether text extraction or OCR sends them elsewhere.
Model requestThe selected model, serving endpoint and where inference runs; any configured fallback.
Connected toolsWhich searches, integrations or outgoing messages can receive source text.
StorageWhere prompts, answers, attachments, logs and backups remain, and who can access them.
Final outputWho receives the report and whether its quotations, metadata or screenshots reveal excluded details.

A smaller packet for a UAE reporting task

In a hypothetical delivery-summary task, the operator may need a delivery ID, status and reason note. A customer's phone number and home address may add nothing to that summary. Prepare an approved export with the fields the task needs, keep the identity mapping outside the model's context, and use synthetic records for the first test.

For Arabic and English notes, preserve the language needed to judge the task. Replacing identifying details should not remove the wording that explains a delay. Ask a fluent reviewer to check meaning using the same limited packet.

Before introducing real records, inspect the client's selected endpoint and enabled tools. Run synthetic cases and record the observed destinations and retained files. An offline test can show which steps need connectivity; it cannot by itself prove how a connected version handles data or how every backup behaves.

Download the private AI data-flow worksheet to record those checks and unresolved questions. No privacy audit has been performed on the reader's system by this article. If a destination or retention rule is unknown, leave it unknown and resolve it before sending material that depends on that answer.

The LM Studio/Ollama comparison tests a small local API task. Pair its setup notes with the permission matrix and the UAE workflow-readiness guide when assessing a team workflow.

Test the private workflow and its operating cost

Once the data-flow worksheet names the actual destinations, use the workflow evaluation guide to test what the system does with missing, conflicting and malicious input. The AED planning worksheet records the setup, review and maintenance work. Neither a local endpoint nor a budget total replaces the destination and retention checks above.

Suhail Mohebi · published 14 July 2026 · the cover is a generated illustration

Use this

Context disclosure gateMarkdown · v1.1 · 14 Nov 2026 · 8 KB
Download the template (.md) ↓

← Previous: The verification loop: five checks for AI-assisted work

Want this inside your team’s workflow? The Verified AI Operations Sprint tests one workflow in ten working days. See the sprint →

Choose the audience first
  1. Choose the audience first
  2. Sort context into four classes
  3. Use minimum sufficient context
  4. Turn a private note into a public pattern
  5. Write a public-safe task packet
  6. Separate the context layers
  7. Run the disclosure gate
  8. Oversharing and over-redaction
  9. Private AI: trace the whole data flow
  10. A smaller packet for a UAE reporting task
  11. Test the private workflow and its operating cost