At a glance
- Controls
- CWE-201
What it is
Features that call a model often send whole records, logs or files as context. These can contain API keys, session tokens or personal data. Once sent, the data sits with the provider and in any logs along the way.
An attacker who reaches prompt logs, a shared conversation or the model's response can read those secrets. Prompt injection can also make the model repeat its context back to the user. AI-assisted attackers are skilled at writing inputs that draw hidden context out of a model.
Where it hides
What a reviewer can look for in the code and in the behaviour, before anyone proves it.
- Support or chat features that attach full customer records to each prompt
- Debugging and log-summary tools that send raw logs with tokens in them
- Coding assistants given access to files that hold environment variables or keys
- Prompt and response logs kept by the product or an observability tool
How MATT tests it
The proof runs against the deployed product, on every release, whoever wrote the code.
- 01Read the code that builds prompts and list every field and file it adds to the context.
- 02Sign in with the test login, place a unique fake secret in a test record, and use the feature on that record.
- 03Check the outgoing request, the stored logs and the model's reply for the fake secret.
Secrets and customer data must be removed before anything is sent to a model.
Executable checkas test user: use the AI feature on a record holding a canary key expect: the canary key is absent from the outgoing prompt expect: the canary key is absent from stored prompt logs expect: customer identifiers are masked in the prompt
Every rule MATT holds →What the fix looks like
- 01
Build prompts from an explicit list of allowed fields.
- 02
Run a redaction step that removes keys, tokens and personal data before any call to a model.
- 03
Keep secrets out of files and folders that assistants and agents can read.
- 04
Limit how long prompt logs are kept and who can read them.
A check that was never written is found by proving the deployed behaviour, fixed with the engineer who shipped it, and kept fixed by running the control on every change. What is ExploitOps? →