# MCP Tool Validation

> Learn how to configure content validation for Model Context Protocol (MCP) tools in GenAI Script.

[Your browser does not support the audio element.](https://microsoft.github.io/genaiscript/llms-full.txt.mp3 "Generated by 🤖 AI with random voice personality. Content interpretation may vary.")

Generated by 🤖 AI

GenAIScript added a few feature to secure Model Context Protocol (MCP) tools and mitigate specific attacks such as rug pull, tool poisoning, or prompt injection.

Starting with `v1.127`, you can configure the following options as [documented here](/genaiscript/reference/scripts/mcp-tools#security):

* tools signature hash to prevent rug pull attacks, where the list of tools is modified without your knowledge.

```js
script({
    mcpServers: {
        playwright: {
            ...,
            toolsSha: "..."
        }
    }
})
```

* prompt injection detect using [content safety scanner](/genaiscript/reference/scripts/content-safety). This will scan both the tools definition file, to prevent **tool poisoning** and every tool output, to prevent **prompt injection**.

```js
script({
    mcpServers: {
        playwright: {
            ...,
            detectPromptInjection: "always"
        }
    }
})
```

* in fact, every tool can be instrumented with content safety scanning.

```js
defTool("fetch", "Fetch a URL", { url: { type: "string" }, },
    async args => ..., {
    detectPromptInjection: "always"
})
```

### Are we done?

[Section titled “Are we done?”](#are-we-done)

There are still many other security aspects to consider when using MCP tools, these features are just a few of them.