NNULLTRACE
NullTrace/Blog/How to Detect Prompt Injection in an API

NULLTRACE TECHNICAL BLOG · 28 SEPTEMBER 2026

How to Detect Prompt Injection in an API

Use readable prompt-injection signals at the API boundary and combine them with broader application controls.

Prompt injection appears when untrusted text attempts to influence model instructions. User messages, retrieved pages, tickets, and tool results can become attack surfaces.

Return signals

{
  "injection_detected": true,
  "signals": ["IGNORE_INSTRUCTIONS","SYSTEM_PROMPT_LEAK"]
}

Observe before blocking

Start with detection signals, measure false positives, and define enforcement rules around real workflows. Detection is not authorization.

Detection guide · API reference

NEXT STEP

Put the privacy boundary in code.

Start with one protected request and expand from there.

Open quickstart →