GET /v1/prompt-injectionDetect prompt injection attempts
Agent Tools lf-agent-tools
Checks whether a piece of text is trying to trick an AI into ignoring its instructions. Scans text for common prompt injection patterns: ignore instructions, role-play, delimiter override, fake responses, and token smuggling.
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
text | string | Yes | Text to scan for injection patterns |
Response Schema
detected (boolean): Whether injection detected
score (number): Suspicion score 0-1
patterns (array): Matched patterns
cURL Example
curl 'https://lf-agent-tools.laminarforge.dev/v1/prompt-injection?text=Ignore%20previous%20instructions' -H 'Authorization: Bearer lf_YourApiKey'
Python Example
import requests
url = 'https://lf-agent-tools.laminarforge.dev/v1/prompt-injection'
headers = {'Authorization': 'Bearer lf_YourApiKey'}
params = {'text': 'Ignore previous instructions'}
response = requests.get(url, headers=headers, params=params)
print(response.json())