Ana içeriğe geç

List AI Prompt-Guard Presets

Endpoint

GET /apiops/settings/ai-prompt-guard-presets/

Authentication

Requires a Personal API Access Token with admin privileges.

Authorization: Bearer YOUR_TOKEN

Request

Headers

HeaderValueRequired
AuthorizationBearer {token}Yes

Path Parameters

None.

Query Parameters

ParameterTypeRequiredDefaultDescription
projectIdstringNoadminScope project id. Omit for the admin/global scope, where built-in and admin-owned presets live.

Response

Success Response (200 OK)

{
"status": "SUCCESS",
"resultList": [
{
"id": "665f3b2d8c4f5b0013cd45ef",
"projectId": "admin",
"name": "BUILTIN_APG_DAN",
"ruleValue": "(?i)ignore (all|previous) instructions",
"action": "BLOCK",
"category": "jailbreak",
"description": "Classic DAN / instruction-override jailbreak attempt",
"enabled": true,
"builtIn": true
},
{
"id": "665f3b2d8c4f5b0013cd77aa",
"projectId": "admin",
"name": "block-internal-hostnames",
"ruleValue": "(?i)internal\\.corp\\.local",
"action": "FLAG",
"category": "system-leak",
"description": "Flags mentions of internal hostnames",
"enabled": true,
"builtIn": false
}
],
"resultCount": 2
}

Response Fields

FieldTypeDescription
statusstringResponse status: SUCCESS or FAILURE
resultListarrayList of prompt-guard preset objects
resultCountintegerTotal number of presets returned

Prompt-Guard Preset Object Fields

FieldTypeDescription
idstringServer-assigned identifier (read-only)
projectIdstringScope the preset belongs to (admin for global)
namestringUnique preset name (e.g. BUILTIN_APG_DAN)
ruleValuestringJava regex pattern matched against prompt content
actionstringAction applied on match: BLOCK, FLAG, MASK
categorystringOptional category label (e.g. jailbreak, injection, system-leak)
descriptionstringOptional description for display
enabledbooleanWhether the preset is active
builtInbooleantrue for Mongock-seeded rows (read-only), false for user-created

EnumStatus

  • SUCCESS - Operation successful
  • FAILURE - Operation failed

Error Response (400 Bad Request)

Returned when the caller is authenticated but lacks the ADMIN role.

{
"status": "FAILURE",
"resultMessage": "Unauthorized! Only users with ADMIN role can manage AI presets!"
}

Error Response (401 Unauthorized)

{
"status": "FAILURE",
"resultMessage": "Token is not valid!"
}

cURL Example

Default (admin/global scope)

curl -X GET \
"https://demo.apinizer.com/apiops/settings/ai-prompt-guard-presets/" \
-H "Authorization: Bearer YOUR_TOKEN"

Scoped to a project

curl -X GET \
"https://demo.apinizer.com/apiops/settings/ai-prompt-guard-presets/?projectId=MyProject" \
-H "Authorization: Bearer YOUR_TOKEN"

Notes and Warnings

  • Admin Only:
    • Only sysAdmin users (or users with the ADMIN role) can list AI prompt-guard presets
    • A project-scoped AI_DEVELOPMENT token is not sufficient
  • Built-in Presets:
    • Rows with builtIn: true come from the seeded OWASP LLM01 catalog and are read-only
  • Action Semantics:
    • BLOCK rejects the traffic (403); FLAG lets it pass and records a guardrail hit; MASK redacts the matched region
  • Scope:
    • The default scope is admin/global; pass projectId to list presets for a specific project
  • No Secret Fields:
    • Prompt-guard presets carry no secret (@SecretData) fields, so no values are masked