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

# Guard

> Input validation and policy rules

# Guard

The guard scans input for unsafe instructions (e.g., prompt injection).

```ts theme={null}
import { guard } from '@agntor/sdk';

const policy = {
  injectionPatterns: [/ignore previous instructions/i, /reveal system prompt/i],
  cweMap: { 'prompt-injection': 'CWE-20' },
};

const result = await guard(input, policy);
```
