# Guardrails

> Block, redact or record secrets, personal data, prompt injection, jailbreaks and confidential files in requests, plus your own word and pattern rules.

Source: https://digitspace.ai/docs/control/guardrails · Last checked: 2026-10-31

Guardrails check each request before it's sent to a provider. Owners and admins set them up under **Guardrails** in the dashboard; a project can have its own settings, otherwise the organisation's apply. Changes take effect within about 15 seconds.

## Built-in checks

| Check                      | Finds                                                                                                                        |
| -------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
| **Secrets and keys**       | Private keys, AWS access keys, GitHub, Slack, Stripe and Google API tokens, AI provider API keys, JWTs, password assignments |
| **Personal data**          | Email addresses, card numbers (Luhn-checked), US social security numbers, phone numbers, IBANs                               |
| **Prompt injection**       | "Ignore previous instructions", requests to reveal the system prompt, fake role markers, injected new instructions           |
| **Jailbreak attempts**     | "Do anything now", invented special modes, "no restrictions" and similar                                                     |
| **Confidential documents** | "Confidential", "internal only" and "do not distribute" markings                                                             |
| **File types and sizes**   | Files that aren't an allowed type (JPEG, PNG, GIF, WebP, PDF, plain text) or are larger than the limit (1 to 50 MB)          |

Each check has an action:

- **Block:** the request is refused.
- **Redact:** the match is replaced with `[REDACTED]` (a refused file with `[file removed]`), and the request goes ahead.
- **Warn:** the request goes ahead unchanged and the match is recorded.

## Custom rules

Add up to 50 of your own:

- **Words or phrases:** up to 200 terms, matched as whole words or anywhere, with or without case.
- **A pattern:** a regular expression up to 300 characters. Patterns with nested repetition or backreferences are refused, so a rule can't slow requests down.

A rule can apply to the whole organisation or to one project.

## What's checked

The system prompt, every message's text, tool results, and images sent as data URLs. **Answers from the model aren't checked**, and neither are tool definitions.

## What the caller sees

A blocked request gets `400` with the code `content_blocked`:

```json
{
  "error": {
    "message": "This request was blocked by your organization's guardrails: Secrets and keys.",
    "type": "invalid_request_error",
    "code": "content_blocked"
  }
}
```

DigitSpace also runs platform-wide rules. When both apply, a check is on if either turns it on, and the stricter action wins.

## Try it and review

**Try it** on the Guardrails page runs your settings on sample text and shows whether it would be sent, redacted or blocked. **What was caught** lists matches over the last 7, 30 or 90 days. Only a fingerprint of each match is kept, never the text itself.
