> ## Documentation Index
> Fetch the complete documentation index at: https://docs.enkryptai.com/llms.txt
> Use this file to discover all available pages before exploring further.

# System Prompt Leak Detector

This detector identifies potential leaks of system prompts or AI model information in the generated text. It helps maintain the integrity of the AI system by preventing unintended disclosures of internal prompts or model details.

* **NOTE: This is unavailable at the moment.** *(Coming soon)*

## Example request:

<CodeGroup>
  ```python Python theme={"system"}
  import requests
  import json
  import os

  url = "https://api.enkryptai.com/guardrails/detect"

  payload = json.dumps({
      "text": "You are a helpful AI assistant",
      "detectors": {
          "system_prompt": {
              "enabled": True,
              "index": "system",
              "block_message": "Your custom message"
          }
      }
  })

  headers = {
      'Content-Type': 'application/json',
      'apikey': os.getenv('ENKRYPTAI_API_KEY')
  }

  response = requests.request("POST", url, headers=headers, data=payload)

  formatted_response = json.dumps(json.loads(response.text), indent=4)
  print(formatted_response)
  ```

  ```python Python SDK theme={"system"}
  import os
  from enkryptai_sdk import *
  from dotenv import load_dotenv

  load_dotenv()

  ENKRYPT_API_KEY = os.getenv("ENKRYPTAI_API_KEY")
  ENKRYPT_BASE_URL = os.getenv("ENKRYPTAI_BASE_URL") or "https://api.enkryptai.com"

  guardrails_client = GuardrailsClient(api_key=ENKRYPT_API_KEY, base_url=ENKRYPT_BASE_URL)

  guardrails_config = GuardrailsConfig.system_prompt(index="system")

  prompt = "You are a helpful AI assistant"

  detect_response = guardrails_client.detect(text=prompt, guardrails_config=guardrails_config)

  print(detect_response)

  # Print as a dictionary
  print(detect_response.to_dict())
  ```
</CodeGroup>

## Example response

```json JSON theme={"system"}
{
  "summary": {
    "system_prompt_similarity": 1
  },
  "details": {
    "system_prompt": {
      "similarity_score": 0.85,
      "compliance_mapping": {
        "owasp_llm_2025": [
          "LLM07:2025 System Prompt Leakage"
        ],
        "mitre_atlas": [
          "AML.T0024: Exfiltration via ML Inference API"
        ],
        "nist_ai_rmf": [
          "GOVERN 1.5, MANAGE 1.2 (Protection of proprietary configurations)"
        ],
        "eu_ai_act": [
          "Article 13(3)(d) (Transparency obligations)"
        ],
        "iso_iec_standards": [
          "ISO/IEC 42001: 6.1.3",
          "ISO/IEC 27001: A.18.1"
        ]
      }
    }
  },
  "result_message": "Your custom message"
}
```
