# lg_guardrails_set: Tighten guardrails

Change guardrails on the organization, a workspace or a key. As an agent you may only make them stricter; loosening is done by a person in the web app.

- **Changes data:** yes
- **Credential scope:** `gateway:write` (an API key's scopes, or what you allowed when connecting with OAuth)
- **Assistant level:** an assistant at Full; a lower level is refused

## Inputs

| Field | Type | Required | Notes |
|---|---|---|---|
| `scope` | string | yes |  |
| `id` | string | yes |  |
| `body` | object (allowed_models, denied_models, allowed_providers, denied_providers, data_collection, zdr, eu_only, sensitive_info, prompt_injection) | no |  |
| `body.allowed_models` | array of string or null | no |  |
| `body.denied_models` | array of string | no |  |
| `body.allowed_providers` | array of string or null | no |  |
| `body.denied_providers` | array of string | no |  |
| `body.data_collection` | "allow" \\| "deny" | no |  |
| `body.zdr` | boolean | no |  |
| `body.eu_only` | boolean | no | Only endpoints in the EU |
| `body.sensitive_info` | "off" \\| "log" \\| "redact" \\| "block" | no | Secrets, card numbers, personal data: log, redact before sending, or refuse |
| `body.prompt_injection` | "off" \\| "log" \\| "block" | no |  |

## Example MCP call

A `tools/call` request to `https://manage.restolayer.com/mcp`:

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "lg_guardrails_set",
    "arguments": {
      "scope": "key",
      "id": "gk_01jabcdefghjkmnpqrstvwxyz0",
      "body": {
        "eu_only": true,
        "sensitive_info": "redact"
      }
    }
  }
}
```

## Example REST call

The same thing over REST (`PUT /v1/guardrails/:scope/:id`):

```bash
curl -s -X PUT "https://manage.restolayer.com/v1/guardrails/key/gk_01jabcdefghjkmnpqrstvwxyz0" \
  -H "Authorization: Bearer $LG_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"eu_only":true,"sensitive_info":"redact"}'
```

All tools: [MCP tools](https://www.restolayer.com/docs/mcp/tools). Connecting: [connect your assistant](https://www.restolayer.com/docs/connect).
