Skip to content

Commit ededebb

Browse files
getting started guardrails configuration
2 parents d5783ef + d2aa6cd commit ededebb

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

docs/mcp-scan/guardrails.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,26 @@ This guide covers how to structure guardrail configs, write custom rules, and ap
1919
!!! note
2020
By default, the configuration file is located at `~/.mcp-scan/guardrails-config.yml`.
2121

22+
!!! info "Get Started Directly"
23+
Just looking to get started quickly? The following example provides a quick way to get started with writing your very own config file. Just copy
24+
it into your config file and replace the client and server names.
25+
```yaml
26+
<client-name>: # your client's shorthand (e.g., cursor, claude, windsurf)
27+
<server-name>: # your server's name according to the mcp config (e.g., whatsapp-mcp)
28+
guardrails:
29+
secrets: block # block calls/results with secrets
30+
31+
custom_guardrails:
32+
# define a rule using Invariant Guardrails, https://explorer.invariantlabs.ai/docs/guardrails/
33+
- name: "Filter tool results with 'error'"
34+
id: "error_filter_guardrail"
35+
action: block # or 'log'
36+
content: |
37+
raise "An error was found." if:
38+
(msg: ToolOutput)
39+
"error" in msg.content
40+
```
41+
2242
## File structure
2343

2444
The configuration file defines guardrailing behavior hierarchically, scoped by **client**, **server**, and **tool**. Below is a structured overview of the YAML format:

0 commit comments

Comments
 (0)