Technical Guide
Detecting an LLM Being Used Outside Its Approved Purpose
To detect LLM use outside approved purpose, express the purpose as testable policy attributes (tasks, data sources, tools, user roles, output types), capture runtime telemetry that ties every prompt, data access, and tool call to an identity, evaluate that telemetry against the policy inline, and write each decision to an audit log. Identity, data, and tool signals are more reliable than content signals, so use them together.
A detection architecture that combines monitoring, enforcement, and logging
Detection depends on three functions working together: runtime monitoring that observes each request and action, inline enforcement that compares them with policy, and audit logging that records every decision and its context.
From approved purpose to audit evidence
- DefineTranslate the approved-use statement into policy attributes that can be checked.
- ObserveCapture prompts, responses, identity, data access, and tool calls at runtime.
- DecideCompare each request and action with the policy baseline.
- EnforceAllow, block, or escalate before an out-of-scope action completes.
- RecordWrite decisions and context to audit logs that support review.
Define approved purpose in machine-checkable terms
An approved-use statement can only be enforced if it can be tested. Express the purpose as policy attributes that each request and action can be compared against:
- Tasks: the work the LLM is approved to perform.
- Data sources: the data the LLM is approved to access.
- Tools: the tools the LLM or agent is approved to call.
- User roles: who is approved to use it.
- Output types: the kinds of output it is approved to produce.
Signals that indicate out-of-purpose use
Identity, data, and tool signals are more reliable than content signals. The table maps each signal family to the telemetry that supplies it, and the families work best when used together.
| Signal family | Telemetry that supplies it | Reliability |
|---|---|---|
| Identity | User, agent, and credential for every request, including the originating user on delegated calls | More reliable |
| Data | Data sources accessed, with the operation performed | More reliable |
| Tools | Tool name, parameters, result status, and any approval step | More reliable |
| Content | Request and response metadata, with content retained or redacted according to your data handling rules | Less reliable on its own |
Limitations, false positives, and evasion
Content signals are less reliable than identity, data, and tool signals, so a decision should not rest on content alone. Combining signal families, and evaluating them against the policy baseline rather than in isolation, is the approach this guide recommends.
Evaluating a runtime governance layer
When assessing a runtime governance layer, check whether it supports each step of the detection flow above:
- Policy attributes cover tasks, data sources, tools, user roles, and output types.
- Every prompt, data access, and tool call is tied to an identity.
- Telemetry is evaluated against the policy inline, so requests can be allowed, blocked, or escalated before an out-of-scope action completes.
- Each decision and its context is written to an audit log that supports review.
Telemetry to capture for investigation and audit
- Identity: user, agent, and credential for every request, including the originating user on delegated calls
- Request and response metadata, with content retained or redacted according to your data handling rules
- Data sources accessed, with the operation performed
- Tool calls, including tool name, parameters, result status, and any approval step
- Policy version, evaluated attributes, and the decision taken (allow, block, escalate)
- Timestamps and integrity protection so records can be shown to be complete and unaltered