Prompt Scanner: Check PII, Secrets, and Injection Risk
Use a prompt scanner to inspect text for PII, secrets, and injection signals before an LLM receives it, then review the evidence and set a policy.

A prompt scanner checks text before it reaches an LLM for sensitive data and instructions that try to change the model's job. The useful output names the matched evidence, its location, and the policy decision a team needs to review. OWASP's current LLM guidance treats prompt injection as a core application risk because a model can receive attacker-controlled instructions inside content that a user merely asked it to read.
A security team can use a prompt scan on a pasted user request, a retrieved knowledge-base passage, or tool output destined for the next model call. The scanner is a measurement point. It tells the team what reached that point; production enforcement needs a policy decision on the routed HTTP request.
TL;DR
A prompt scanner should inspect the complete text assembled for an LLM request, show the evidence behind every detection, and connect the result to a defined policy action. It helps a team measure a risk surface before the request reaches the model; runtime enforcement applies that policy to each routed HTTP request.
What a prompt scanner should inspect
A prompt scanner needs separate detectors because a credit-card pattern, a private key, and an instruction override have different evidence. PII detection in LLM prompts explains why a classifier needs to handle both structured identifiers and free-form text.
Personal and regulated data
Start with patterns that have a clear shape: email addresses, government identifiers, payment-card candidates, account references, and telephone numbers. Context changes the decision during a production review. A phone number in a public switchboard footer has a different meaning than a list of patient contacts pasted into a consumer model prompt.
Clinical text requires an additional review path. HHS de-identification guidance describes two HIPAA de-identification methods, Safe Harbor and Expert Determination, and lists the identifier categories Safe Harbor addresses. A scanner can flag likely identifiers and clinical context; counsel and the covered entity determine the permitted handling.
The report should preserve the detector name and the evidence span without reproducing the full sensitive prompt in a shared dashboard. That detail makes a false positive review possible and reduces the chance that the scanner becomes another copy of the data it found.
Secrets and credentials
A useful secret detector recognizes recognizable prefixes and structural markers, then gives the reviewer enough context to rotate or revoke the credential. Examples include a private-key header, a connection string containing a password, or a cloud access-key format. Entropy alone can produce noisy findings, especially in logs and encoded payloads, so a scanner should label the signal rather than present every long string as a confirmed secret.
This is the place where a paste made while debugging can turn into an outbound data transfer. The request may look like ordinary troubleshooting in a browser tab, while the prompt body carries access material to a third-party model endpoint. A scanner makes that boundary visible before the request leaves the application.
Prompt injection signals
Prompt injection has two common entry paths. Direct injection arrives in the user's submitted text. Indirect injection arrives inside retrieved documents, emails, webpages, or tool output that an agent sends into its context. The OWASP LLM Top 10 documents the risk and the ways untrusted content can steer an LLM application.
A scan should identify the exact signal it found: an instruction override, an attempt to disclose a system prompt, a concealed Unicode character, an encoded instruction, or a request for secret extraction. The detector result remains a signal, not proof that an attack succeeded. Reviewers need the original source, the agent's intended task, and the policy that governs the next model request.
Prompt scan workflow
A prompt scan is most useful when its result maps to an action. The workflow below connects the finding to that action.
Choose the text at the model boundary. Scan the final assembled prompt, including retrieved content and agent-provided context, before the HTTP request goes to the LLM.
Read the evidence, not only the verdict. Confirm the matched span, detector family, confidence, and source component. A redacted excerpt is safer than copying the whole prompt into a ticket.
Assign a policy outcome. A finding can cause a block, a redaction, a route to human review, or an allow decision with an audit record. The outcome belongs to the application's risk policy.
Test the rule against real samples. Keep a small labelled set of legitimate prompts and known bad inputs. Review the results after a rule change, then record the policy version that made the decision.
The physical detail matters during this work. A scanner result displayed as a single highlighted line beside the source name gives a reviewer more than a large red badge ever will. The badge tells you that something fired; the line tells you what policy needs attention.
Limits of a prompt scanner
A scanner examines the text it receives. It cannot prove the model will follow a malicious instruction, and it cannot authorize a later tool call that happens outside the routed model request. Prompt injection detection in production separates prompt inspection from the authorization control needed at a tool endpoint.
The scanner also cannot turn a local finding into a compliance conclusion. A detected clinical identifier needs the deployment's HIPAA analysis. A detected payment-card value needs the organization's payment-data policy. Security teams should avoid treating a green result as permission to send any text to any provider.
That is an opinion I hold firmly: a scanner that returns only "safe" or "unsafe" is too thin for an enterprise review. The valuable artifact is the evidence and the decision attached to it.
DeepInspect
DeepInspect operates at the HTTP AI request boundary between authenticated users or agents and the LLM endpoint they call. A configured policy can evaluate the scanner's data-class or injection signals for each routed request, apply the selected action, and retain a per-decision audit record.
This scope matters. The gateway can inspect deliberately routed prompt and response traffic. Tool execution, local processes, and other downstream actions need controls at their own authorization boundaries. The AI gateway glossary describes the request path that a gateway can actually observe.
A scanner gives a team a first view of the content entering that path. The production policy decides what happens to a specific authenticated HTTP request. Book a technical deep dive at deepinspect.ai.
Frequently asked questions
- What is a prompt scanner?
A prompt scanner inspects text intended for an LLM and reports signals such as sensitive-data patterns, credentials, and prompt-injection instructions. It should show the evidence that produced each finding so a reviewer can validate the result.
- What should I scan for prompt injection?
Scan the final prompt assembled for the model, including user text, retrieved documents, email content, webpages, and tool output. Indirect injection often enters through material that the user expected the agent to read rather than obey.
- Can a prompt scanner detect PII?
It can flag likely PII with rules and contextual classifiers. The finding needs a policy review because identifier type, jurisdiction, source, and destination affect the permitted handling.
- Does a prompt scanner replace runtime enforcement?
A scanner provides a point-in-time measurement. Runtime enforcement evaluates each routed request against the policy in force, applies an action, and records the decision. The two serve different operating moments.
- Should the scanner retain submitted prompts?
Retaining full prompts creates another sensitive-data store. Keep only the minimum evidence needed for review, protect access to it, and define retention before collecting production samples.