Learn how to set up and implement guardrails to ensure safe and compliant LLM interactions and MCP tool invocations.
To get started with integrating and using Guardrails, follow the steps below:
1
Create a Guardrails Group
A guardrails group serves as a container for multiple guardrail integrations. You can assign who can add/edit/remove guardrails in a group and who can access the guardrails in a group. There are two type of roles for collaborators:
Manager: Can create, edit, delete and use the guardrail integrations in the group.
User: Can use the guardrail integrations in the group.
To create a guardrails group, navigate to AI Gateway → Guardrails. Give your group a name. In our case, we’ve named it openai-guardrail.
Create a Guardrails Group
Give your group a name
A Guardrail Group is the minimum level of access control for guardrails.A common usage pattern is to create an org-wide global guardrails group which contains the organization wide guardrails. The Platform team is the manager and the entire org are users of the guardrail.For team/product specific guardrails, its better to create individual guardrail groups per product / team.
2
Add Guardrail Integration in Guardrails Group
You can add integrations to your guardrails for content moderation and safety. Let’s create an OpenAI guardrail integration, which we will later use as an output guardrail in our configuration example. This will allow us to automatically moderate and filter responses from the LLM using OpenAI’s moderation capabilities.
Select the OpenAI Moderation from the list of integrations.
Select the OpenAI Moderation Integration
Fill in the OpenAI Moderation Guardrail Config form. For this tutorial, we’ve named it tfy-openai-moderation.
Fill in the OpenAI Moderation Form
Save the guardrail group.
You are now ready to use this OpenAI guardrail integration in your guardrail configuration to moderate LLM inputs. This means the guardrail will be applied to the input prompts before they are sent to the LLM, helping to ensure that any unsafe or non-compliant content is detected and handled prior to model processing.
To customize moderation sensitivity for specific categories such as harassment, sexual, or hate, enable the Category Thresholds option. You can then adjust the threshold values for each category according to your requirements.
3
Test Guardrails in Playground
The Playground allows you to test guardrails on all four hooks before deploying to production.
Once you have configured guardrail policies in AI Gateway → Policies → Guardrails, you can test MCP Pre Tool and Post Tool guardrails from the Playground:
Configure Guardrail Policies First
Navigate to AI Gateway → Policies → Guardrails and create rules that target your MCP servers/tools with guardrails on the MCP Tool Pre-Invoke or Post-Invoke hooks.
Use the Playground with MCP Tools
In the Playground, when you invoke MCP tools (via agents or tool calls), the configured guardrails will automatically execute on the Pre Tool and Post Tool hooks.
View Results in Traces
After execution, navigate to Monitor → Request Traces to see detailed information about which guardrails were triggered on each MCP tool invocation, including:
Pre Tool guardrail validation results
Post Tool guardrail findings and mutations
Pass/fail status for each guardrail
Testing in the Playground is an easy way to validate that your guardrails are correctly configured before deploying to production. For MCP guardrails, use the Request Traces view to verify guardrails are triggering as expected on tool invocations.
4
Trigger Guardrails in LLM requests from code
You can add extra guardrails on a single request with the X-TFY-GUARDRAILS header. Matching gateway policies still run. You can copy the relevant code snippet from the Playground section.
Select the Guardrail to Apply
On the left side, choose the LLM Input Guardrails and LLM Output Guardrails sections, and select the guardrails you want to apply. For this tutorial, we’ve selected the tfy-openai-moderation guardrail for both input and output.
Select the Guardrail to Apply
Get the Code Snippet
After configuring your request and selecting the desired guardrail(s), click the Code button at the top right of the Playground.
In the code snippet section, you will see ready-to-use examples for different SDKs and curl. Note: The generated code will automatically include the necessary X-TFY-GUARDRAILS header with your selected guardrails.
Code Snippet Section
Copy and Run the Code
Copy the generated curl command (or code for your preferred SDK) and run it.
The guardrails you selected in the Playground will be applied automatically, as reflected in the request headers.
Add the X-TFY-GUARDRAILS header from any HTTP client or SDK. It adds those guardrails for this request only. Matching gateway policies still run.
For backward compatibility, input_guardrails maps to llm_input_guardrails and output_guardrails maps to llm_output_guardrails.
5
Configure guardrail policies at gateway layer
Registering a guardrail integration doesn’t apply it to any traffic by itself — you also need a guardrail policy that defines when to apply which guardrails.
Navigate to Guardrail Policies
Go to AI Gateway → Policies → Guardrails to access the Guardrail Policies page.
Create a Guardrail Rule
Click Add New Guardrail Rule, set a unique Configuration Name, and fill in the form:
Under When Request Goes To, target specific models or MCP servers
Under From Subjects, filter by the users, teams, or virtual accounts making the request
Under Apply on Hooks, attach your registered guardrails to any of the four hooks:
LLM Input - Before LLM request
LLM Output - After LLM response
MCP Tool Pre-Invoke - Before MCP tool invocation
MCP Tool Post-Invoke - After MCP tool returns
Submit the Rule
After filling out the form, click Submit to save this named policy (each rule is its own gateway-guardrails-config).
Guardrail policy rule targeting models and MCP servers with guardrails applied on hooks
For more details on how to configure guardrail policies, including custom error messages and YAML configuration, see Configure Guardrail Policies.
Configuring guardrails at the AI Gateway layer is recommended for organization-wide enforcement. This centralizes guardrail management and auditing, eliminating the need to set headers on every request. MCP tool guardrails are especially important for securing agentic workflows.
6
Monitor Guardrail Execution
After configuring guardrails, you can verify they are being applied correctly by monitoring execution in real-time through the AI Gateway dashboard:
Navigate to AI Gateway → Monitor → Request Traces
View detailed traces showing which guardrails were triggered on each hook
See findings, mutations, and execution timing for each guardrail
Filter by guardrail status to quickly find blocked or flagged requests
Guardrail latency visible in Request Traces
Use the Request Traces view to debug guardrail behavior, identify false positives during audit mode rollout, and verify your configuration is working as expected.
7
Detect Guardrail Violations Programmatically
When a guardrail blocks a request, the AI Gateway returns a 400 status code with error.type set to guardrail_checks_failed. You can use this to handle violations in your application.
from openai import OpenAIclient = OpenAI( api_key="your_truefoundry_api_key", base_url="{GATEWAY_BASE_URL}")try: response = client.chat.completions.create( model="openai-main/gpt-4o-mini", messages=[ {"role": "user", "content": "How do I write a function to calculate factorial?"} ] ) print("Response:", response.choices[0].message.content)except Exception as e: if hasattr(e, 'response') and e.response is not None: error_data = e.response.json() if error_data.get('error', {}).get('type') == 'guardrail_checks_failed': print("Guardrail violation detected!") checks = error_data.get('guardrail_checks', {}) for hook in ['llm_input_guardrails', 'llm_output_guardrails', 'mcp_tool_pre_invoke_guardrails', 'mcp_tool_post_invoke_guardrails']: if checks.get(hook): print(f"Violation on: {hook}")
The guardrail_checks object in the error response only contains the hooks that were evaluated for the request.
Was this page helpful?
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"TrueFoundry Docs","description":"TrueFoundry documentation — enterprise-grade AI Gateway combining LLM, MCP, and Agent Gateways to connect, monitor, and govern agentic AI applications across providers from a unified control plane.","colors":{"primary":"#4f46e5","light":"#4f46e5","dark":"#4f46e5"},"logo":{"light":"https://mintcdn.com/truefoundry/e2uUimEwX30qkWxc/logo/light.svg?fit=max\u0026auto=format\u0026n=e2uUimEwX30qkWxc\u0026q=85\u0026s=6068d83664aeda0239bec2422657dd20","dark":"https://mintcdn.com/truefoundry/e2uUimEwX30qkWxc/logo/dark.svg?fit=max\u0026auto=format\u0026n=e2uUimEwX30qkWxc\u0026q=85\u0026s=c1cb26554a546d84500b40f7057bece8"},"favicon":"https://mintcdn.com/truefoundry/6bbtTt95c1iCcyph/favicon.svg?fit=max\u0026auto=format\u0026n=6bbtTt95c1iCcyph\u0026q=85\u0026s=f55bde34214b38034126d05b08ea16c7","appearance":{"default":"light"},"background":{"decoration":"grid"},"navbar":{"links":[{"href":"https://www.truefoundry.com/book-demo","label":"Book Demo"},{"href":"https://www.truefoundry.com/blog","label":"Blog"}],"primary":{"type":"button","label":"Sign Up","href":"https://www.truefoundry.com/register"}},"footer":{"socials":{"x":"https://twitter.com/truefoundry","linkedin":"https://in.linkedin.com/company/truefoundry"}},"seo":{"metatags":{"og:type":"website","og:site_name":"TrueFoundry Docs","og:image":"https://assets.production.truefoundry.com/logo.svg","og:description":"TrueFoundry offers an enterprise-grade AI Gateway combining LLM, MCP, and Agent Gateways—empowering businesses to connect, monitor, and govern agentic AI applications across providers from a unified control plane.","description":"TrueFoundry offers an enterprise-grade AI Gateway combining LLM, MCP, and Agent Gateways—empowering businesses to connect, monitor, and govern agentic AI applications across providers from a unified control plane."}},"icons":{"library":"fontawesome"},"styling":{"codeblocks":"dark","latex":true},"contextual":{"options":["copy","view","chatgpt","claude","mcp","cursor","vscode"],"display":"header"},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"truefoundry","hasAudioNarration":false,"actualSubdomain":"truefoundry","customDomains":["www.truefoundry.com"],"gitSource":{"type":"github","owner":"truefoundry","repo":"docs-mintlify","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"feedback":{"thumbs":true},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6af359e028ea38b72d16b5fb","clientVersion":"0.0.4102","searchFilterCounts":[{"language":"default","tag":"AI Gateway","count":233},{"language":"default","tag":"API Reference","count":202},{"language":"default","tag":"Platform","count":198},{"language":"default","tag":"Integrations","count":132},{"language":"default","tag":"AI Deployment","count":109},{"language":"default","tag":"LLM Gateway","count":100},{"language":"default","tag":"Integrate Models","count":50},{"language":"default","tag":"Observability","count":47},{"language":"default","tag":"Guardrails and Security","count":46},{"language":"default","tag":"Installation Guides","count":44}]},"assistantConfig":{"enableAskAiButton":true,"enableAskAiSearchBar":true,"deflection":{"enabled":true,"email":"support@truefoundry.com","showHelpButton":true}},"basePath":"","hasChatPermissions":true,"hasWebMcpPermissions":true,"toggles":[],"googleFontsInlined":false},"customCss":[{"filePath":"style.css","content":".line-highlight{background:rgb(var(--primary-light)/.7)!important}.tfy-cat-anchor{scroll-margin-top:6rem;margin-block:1.75rem}.line-highlight:before{background:rgb(var(--primary-light)/.7)!important}.line-highlight:after{background:rgb(var(--primary-light)/.7)!important}"}],"page":{"pagePath":"docs/ai-gateway/guardrails-getting-started","slug":"/docs/ai-gateway/guardrails-getting-started","pageMetadata":{"title":"AI Gateway Guardrails: Quick Start","sidebarTitle":"Getting Started","description":"Learn how to set up and implement guardrails to ensure safe and compliant LLM interactions and MCP tool invocations.","href":"/docs/ai-gateway/guardrails-getting-started"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Learn how to set up and implement guardrails to ensure safe and compliant LLM interactions and MCP tool invocations.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,br:`br`,code:`code`,li:`li`,ol:`ol`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Frame,Heading,Note,OptimizedImage,Step,Steps,Table,Tip}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Frame)_missingMdxReference(`Frame`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Note)_missingMdxReference(`Note`,true);if(!OptimizedImage)_missingMdxReference(`OptimizedImage`,true);if(!Step)_missingMdxReference(`Step`,true);if(!Steps)_missingMdxReference(`Steps`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Tip)_missingMdxReference(`Tip`,true);return _jsxs(_Fragment,{children:[_jsx(_components.p,{children:`To get started with integrating and using Guardrails, follow the steps below:`}),`\n`,_jsxs(Steps,{titleSize:`h3`,children:[_jsxs(Step,{title:`Create a Guardrails Group`,id:`create-a-guardrails-group`,children:[_jsx(_components.p,{children:`A guardrails group serves as a container for multiple guardrail integrations. You can assign who can add/edit/remove guardrails in a group and who can access the guardrails in a group. There are two type of roles for collaborators:`}),_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Manager:`}),` Can create, edit, delete and use the guardrail integrations in the group.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`User:`}),` Can use the guardrail integrations in the group.`]}),`\n`]}),_jsxs(_components.p,{children:[`To create a guardrails group, navigate to `,_jsx(_components.strong,{children:`AI Gateway`}),` → `,_jsx(_components.strong,{children:`Guardrails`}),`. Give your group a name. In our case, we’ve named it `,_jsx(_components.code,{children:`openai-guardrail`}),`.`]}),_jsx(Frame,{caption:`Create a Guardrails Group`,children:_jsx(OptimizedImage,{src:`https://mintcdn.com/truefoundry/ObbMHkc6Id9XfbZx/images/add-guardrails-group.png?fit=max\u0026auto=format\u0026n=ObbMHkc6Id9XfbZx\u0026q=85\u0026s=93ed7db909809e89462f2211fc8dee10`,\"data-og-width\":`1921`,width:`1921`,\"data-og-height\":`1036`,height:`1036`,\"data-path\":`images/add-guardrails-group.png`,\"data-optimize\":`true`,\"data-opv\":`3`,srcset:`https://mintcdn.com/truefoundry/ObbMHkc6Id9XfbZx/images/add-guardrails-group.png?w=280\u0026fit=max\u0026auto=format\u0026n=ObbMHkc6Id9XfbZx\u0026q=85\u0026s=51787332dc6f04ccc86c1dd06fc34d7f 280w, https://mintcdn.com/truefoundry/ObbMHkc6Id9XfbZx/images/add-guardrails-group.png?w=560\u0026fit=max\u0026auto=format\u0026n=ObbMHkc6Id9XfbZx\u0026q=85\u0026s=165e76edc8a1b1a1782ea14e8f95e8fb 560w, https://mintcdn.com/truefoundry/ObbMHkc6Id9XfbZx/images/add-guardrails-group.png?w=840\u0026fit=max\u0026auto=format\u0026n=ObbMHkc6Id9XfbZx\u0026q=85\u0026s=c8c24a632466181b96756663207acf36 840w, https://mintcdn.com/truefoundry/ObbMHkc6Id9XfbZx/images/add-guardrails-group.png?w=1100\u0026fit=max\u0026auto=format\u0026n=ObbMHkc6Id9XfbZx\u0026q=85\u0026s=c568d710e52daab81fd8d5dc8f1ec55d 1100w, https://mintcdn.com/truefoundry/ObbMHkc6Id9XfbZx/images/add-guardrails-group.png?w=1650\u0026fit=max\u0026auto=format\u0026n=ObbMHkc6Id9XfbZx\u0026q=85\u0026s=4b505e6bd1469c9ce79597a1e6be8e7a 1650w, https://mintcdn.com/truefoundry/ObbMHkc6Id9XfbZx/images/add-guardrails-group.png?w=2500\u0026fit=max\u0026auto=format\u0026n=ObbMHkc6Id9XfbZx\u0026q=85\u0026s=93490c3b9b95c789809dc19bdd5070fa 2500w`})}),_jsx(Frame,{caption:`Give your group a name`,children:_jsx(OptimizedImage,{src:`https://mintcdn.com/truefoundry/F2Zf4aiTLXb_89wL/images/guardrail-group-name.png?fit=max\u0026auto=format\u0026n=F2Zf4aiTLXb_89wL\u0026q=85\u0026s=cf0e7620ae78bcb9b615f7afb906ed91`,\"data-og-width\":`1918`,width:`1918`,\"data-og-height\":`1037`,height:`1037`,\"data-path\":`images/guardrail-group-name.png`,\"data-optimize\":`true`,\"data-opv\":`3`,srcset:`https://mintcdn.com/truefoundry/F2Zf4aiTLXb_89wL/images/guardrail-group-name.png?w=280\u0026fit=max\u0026auto=format\u0026n=F2Zf4aiTLXb_89wL\u0026q=85\u0026s=9ee7107b0a0604a00fe22bae6f13ba42 280w, https://mintcdn.com/truefoundry/F2Zf4aiTLXb_89wL/images/guardrail-group-name.png?w=560\u0026fit=max\u0026auto=format\u0026n=F2Zf4aiTLXb_89wL\u0026q=85\u0026s=d905fb006540eb282bf967f79abc97ef 560w, https://mintcdn.com/truefoundry/F2Zf4aiTLXb_89wL/images/guardrail-group-name.png?w=840\u0026fit=max\u0026auto=format\u0026n=F2Zf4aiTLXb_89wL\u0026q=85\u0026s=4d223f6658cc23c003c97c5624907036 840w, https://mintcdn.com/truefoundry/F2Zf4aiTLXb_89wL/images/guardrail-group-name.png?w=1100\u0026fit=max\u0026auto=format\u0026n=F2Zf4aiTLXb_89wL\u0026q=85\u0026s=5e7ad2c6881647cdc3e67e9de97b1c36 1100w, https://mintcdn.com/truefoundry/F2Zf4aiTLXb_89wL/images/guardrail-group-name.png?w=1650\u0026fit=max\u0026auto=format\u0026n=F2Zf4aiTLXb_89wL\u0026q=85\u0026s=c310378827e49359866f78f7dc0a21ee 1650w, https://mintcdn.com/truefoundry/F2Zf4aiTLXb_89wL/images/guardrail-group-name.png?w=2500\u0026fit=max\u0026auto=format\u0026n=F2Zf4aiTLXb_89wL\u0026q=85\u0026s=16b92eaf805a694304179fc5881deb2f 2500w`})}),_jsxs(Tip,{children:[_jsx(_components.p,{children:_jsx(_components.strong,{children:`A Guardrail Group is the minimum level of access control for guardrails.`})}),_jsx(_components.p,{children:`A common usage pattern is to create an org-wide global guardrails group which contains the organization wide guardrails. The Platform team is the manager and the entire org are users of the guardrail.`}),_jsx(_components.p,{children:`For team/product specific guardrails, its better to create individual guardrail groups per product / team.`})]})]}),_jsxs(Step,{title:`Add Guardrail Integration in Guardrails Group`,id:`add-guardrail-integration-in-guardrails-group`,children:[_jsx(_components.p,{children:`You can add integrations to your guardrails for content moderation and safety. Let’s create an OpenAI guardrail integration, which we will later use as an output guardrail in our configuration example. This will allow us to automatically moderate and filter responses from the LLM using OpenAI’s moderation capabilities.`}),_jsxs(_components.ol,{children:[`\n`,_jsxs(_components.li,{children:[`\n`,_jsx(_components.p,{children:`Select the OpenAI Moderation from the list of integrations.`}),`\n`,_jsx(Frame,{caption:`Select the OpenAI Moderation Integration`,children:_jsx(OptimizedImage,{src:`https://mintcdn.com/truefoundry/aDsonhGK65KstWLZ/images/select-openai-moderations.png?fit=max\u0026auto=format\u0026n=aDsonhGK65KstWLZ\u0026q=85\u0026s=0c39f97e7023ef625a9809c64add7f81`,alt:`Guardrail integration selection interface showing OpenAI Moderation option`,\"data-og-width\":`1918`,width:`1918`,\"data-og-height\":`1038`,height:`1038`,\"data-path\":`images/select-openai-moderations.png`,\"data-optimize\":`true`,\"data-opv\":`3`,srcset:`https://mintcdn.com/truefoundry/aDsonhGK65KstWLZ/images/select-openai-moderations.png?w=280\u0026fit=max\u0026auto=format\u0026n=aDsonhGK65KstWLZ\u0026q=85\u0026s=b569816f3fa136154159c664a3e2811f 280w, https://mintcdn.com/truefoundry/aDsonhGK65KstWLZ/images/select-openai-moderations.png?w=560\u0026fit=max\u0026auto=format\u0026n=aDsonhGK65KstWLZ\u0026q=85\u0026s=f4ebc728394a29e55d98b7b1f5bd0fdb 560w, https://mintcdn.com/truefoundry/aDsonhGK65KstWLZ/images/select-openai-moderations.png?w=840\u0026fit=max\u0026auto=format\u0026n=aDsonhGK65KstWLZ\u0026q=85\u0026s=df6686016f06532c722a0e22dcd3280b 840w, https://mintcdn.com/truefoundry/aDsonhGK65KstWLZ/images/select-openai-moderations.png?w=1100\u0026fit=max\u0026auto=format\u0026n=aDsonhGK65KstWLZ\u0026q=85\u0026s=6f2247ee17a1927563061bf2dd6798a0 1100w, https://mintcdn.com/truefoundry/aDsonhGK65KstWLZ/images/select-openai-moderations.png?w=1650\u0026fit=max\u0026auto=format\u0026n=aDsonhGK65KstWLZ\u0026q=85\u0026s=e79943f96b8228cfa070c62ae9f18fe7 1650w, https://mintcdn.com/truefoundry/aDsonhGK65KstWLZ/images/select-openai-moderations.png?w=2500\u0026fit=max\u0026auto=format\u0026n=aDsonhGK65KstWLZ\u0026q=85\u0026s=0dfb1c98815cb77250388edf2174f2c1 2500w`})}),`\n`]}),`\n`,_jsxs(_components.li,{children:[`\n`,_jsxs(_components.p,{children:[`Fill in the OpenAI Moderation Guardrail Config form. For this tutorial, we’ve named it `,_jsx(_components.code,{children:`tfy-openai-moderation`}),`.`]}),`\n`,_jsx(Frame,{caption:`Fill in the OpenAI Moderation Form`,children:_jsx(OptimizedImage,{src:`https://mintcdn.com/truefoundry/QK4NdO9qyu5SGRq4/images/openai-guardrail-form.png?fit=max\u0026auto=format\u0026n=QK4NdO9qyu5SGRq4\u0026q=85\u0026s=fb99cfa239bc1505d987f32e1791e053`,alt:`OpenAI Moderation configuration form with fields for name, API key, and operation type`,\"data-og-width\":`1343`,width:`1343`,\"data-og-height\":`1038`,height:`1038`,\"data-path\":`images/openai-guardrail-form.png`,\"data-optimize\":`true`,\"data-opv\":`3`,srcset:`https://mintcdn.com/truefoundry/QK4NdO9qyu5SGRq4/images/openai-guardrail-form.png?w=280\u0026fit=max\u0026auto=format\u0026n=QK4NdO9qyu5SGRq4\u0026q=85\u0026s=0d391ef9c8d13e490e7e609e127ac6b6 280w, https://mintcdn.com/truefoundry/QK4NdO9qyu5SGRq4/images/openai-guardrail-form.png?w=560\u0026fit=max\u0026auto=format\u0026n=QK4NdO9qyu5SGRq4\u0026q=85\u0026s=9aa496412f5c98c4a4e79fcea4d0b7b7 560w, https://mintcdn.com/truefoundry/QK4NdO9qyu5SGRq4/images/openai-guardrail-form.png?w=840\u0026fit=max\u0026auto=format\u0026n=QK4NdO9qyu5SGRq4\u0026q=85\u0026s=01e980fbd47645d39aeca4b7e30ab9d3 840w, https://mintcdn.com/truefoundry/QK4NdO9qyu5SGRq4/images/openai-guardrail-form.png?w=1100\u0026fit=max\u0026auto=format\u0026n=QK4NdO9qyu5SGRq4\u0026q=85\u0026s=575a2657942a77a55c044ed99e6cc07c 1100w, https://mintcdn.com/truefoundry/QK4NdO9qyu5SGRq4/images/openai-guardrail-form.png?w=1650\u0026fit=max\u0026auto=format\u0026n=QK4NdO9qyu5SGRq4\u0026q=85\u0026s=19bf519c83edd8d00575de81db285bcf 1650w, https://mintcdn.com/truefoundry/QK4NdO9qyu5SGRq4/images/openai-guardrail-form.png?w=2500\u0026fit=max\u0026auto=format\u0026n=QK4NdO9qyu5SGRq4\u0026q=85\u0026s=999126ee73f91c8ef1bdcd4cdef2bfc1 2500w`})}),`\n`]}),`\n`,_jsxs(_components.li,{children:[`\n`,_jsx(_components.p,{children:`Save the guardrail group.`}),`\n`]}),`\n`]}),_jsx(_components.p,{children:`You are now ready to use this OpenAI guardrail integration in your guardrail configuration to moderate LLM inputs. This means the guardrail will be applied to the input prompts before they are sent to the LLM, helping to ensure that any unsafe or non-compliant content is detected and handled prior to model processing.`}),_jsxs(Note,{children:[_jsxs(_components.p,{children:[`To customize moderation sensitivity for specific categories such as `,_jsx(_components.code,{children:`harassment`}),`, `,_jsx(_components.code,{children:`sexual`}),`, or `,_jsx(_components.code,{children:`hate`}),`, enable the `,_jsx(_components.strong,{children:`Category Thresholds`}),` option. You can then adjust the threshold values for each category according to your requirements.`]}),_jsx(OptimizedImage,{src:`https://mintcdn.com/truefoundry/n3EuZuJ0K8wBFp1G/images/openai-moderation-threshold.jpeg?fit=max\u0026auto=format\u0026n=n3EuZuJ0K8wBFp1G\u0026q=85\u0026s=4198689443a0c76687163f815ff6002a`,\"data-og-width\":`1280`,width:`1280`,\"data-og-height\":`1135`,height:`1135`,\"data-path\":`images/openai-moderation-threshold.jpeg`,\"data-optimize\":`true`,\"data-opv\":`3`,srcset:`https://mintcdn.com/truefoundry/n3EuZuJ0K8wBFp1G/images/openai-moderation-threshold.jpeg?w=280\u0026fit=max\u0026auto=format\u0026n=n3EuZuJ0K8wBFp1G\u0026q=85\u0026s=6ea491491a172d25d61185745010dc12 280w, https://mintcdn.com/truefoundry/n3EuZuJ0K8wBFp1G/images/openai-moderation-threshold.jpeg?w=560\u0026fit=max\u0026auto=format\u0026n=n3EuZuJ0K8wBFp1G\u0026q=85\u0026s=28c4ecdb0fcfc6ba6eaa9b794c99c54f 560w, https://mintcdn.com/truefoundry/n3EuZuJ0K8wBFp1G/images/openai-moderation-threshold.jpeg?w=840\u0026fit=max\u0026auto=format\u0026n=n3EuZuJ0K8wBFp1G\u0026q=85\u0026s=1841d48565e3e12ee4e121c2c5c75654 840w, https://mintcdn.com/truefoundry/n3EuZuJ0K8wBFp1G/images/openai-moderation-threshold.jpeg?w=1100\u0026fit=max\u0026auto=format\u0026n=n3EuZuJ0K8wBFp1G\u0026q=85\u0026s=69246fc412260d49b48c1e8a1987b999 1100w, https://mintcdn.com/truefoundry/n3EuZuJ0K8wBFp1G/images/openai-moderation-threshold.jpeg?w=1650\u0026fit=max\u0026auto=format\u0026n=n3EuZuJ0K8wBFp1G\u0026q=85\u0026s=da0f628d615ceadfc72f0f0a126d5ca6 1650w, https://mintcdn.com/truefoundry/n3EuZuJ0K8wBFp1G/images/openai-moderation-threshold.jpeg?w=2500\u0026fit=max\u0026auto=format\u0026n=n3EuZuJ0K8wBFp1G\u0026q=85\u0026s=eddf43ab68e0a9456e632f3e6b58d668 2500w`})]})]}),_jsxs(Step,{title:`Test Guardrails in Playground`,id:`test-guardrails-in-playground`,children:[_jsx(_components.p,{children:`The Playground allows you to test guardrails on all four hooks before deploying to production.`}),_jsx(Heading,{level:`3`,id:`testing-llm-input/output-guardrails`,children:`Testing LLM Input/Output Guardrails`}),_jsxs(_components.ol,{children:[`\n`,_jsxs(_components.li,{children:[`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Navigate to the Playground`}),_jsx(_components.br,{}),`\n`,`Navigate to the AI Gateway → Playground Tab.`]}),`\n`]}),`\n`,_jsxs(_components.li,{children:[`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Select Guardrails`}),_jsx(_components.br,{}),`\n`,`On the left side, you’ll see options for `,_jsx(_components.strong,{children:`LLM Input Guardrails`}),` and `,_jsx(_components.strong,{children:`LLM Output Guardrails`}),`.`]}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`Click on either option depending on which hook you want to test.`}),`\n`,_jsx(_components.li,{children:`Add the guardrail you want to apply by selecting from the list.`}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`As we have already created an OpenAI guardrail named `,_jsx(_components.code,{children:`tfy-openai-moderation`}),` in the previous steps, select this guardrail under `,_jsx(_components.strong,{children:`LLM Input Guardrails`}),`.`]}),`\n`,_jsx(Frame,{caption:`Select Guardrails`,children:_jsx(OptimizedImage,{src:`https://mintcdn.com/truefoundry/QK4NdO9qyu5SGRq4/images/playground-guardrails.png?fit=max\u0026auto=format\u0026n=QK4NdO9qyu5SGRq4\u0026q=85\u0026s=a23004240f716bafe9263b2ead8dc39f`,alt:`AI Gateway playground interface with guardrail selection panel on the left side`,\"data-og-width\":`1918`,width:`1918`,\"data-og-height\":`1037`,height:`1037`,\"data-path\":`images/playground-guardrails.png`,\"data-optimize\":`true`,\"data-opv\":`3`,srcset:`https://mintcdn.com/truefoundry/QK4NdO9qyu5SGRq4/images/playground-guardrails.png?w=280\u0026fit=max\u0026auto=format\u0026n=QK4NdO9qyu5SGRq4\u0026q=85\u0026s=addefca6d5e02fb91ceab9a002817c59 280w, https://mintcdn.com/truefoundry/QK4NdO9qyu5SGRq4/images/playground-guardrails.png?w=560\u0026fit=max\u0026auto=format\u0026n=QK4NdO9qyu5SGRq4\u0026q=85\u0026s=a63c4bf5c8ab8ece0ea34a7305029767 560w, https://mintcdn.com/truefoundry/QK4NdO9qyu5SGRq4/images/playground-guardrails.png?w=840\u0026fit=max\u0026auto=format\u0026n=QK4NdO9qyu5SGRq4\u0026q=85\u0026s=ec97f558233855d2db8c4b92b7243428 840w, https://mintcdn.com/truefoundry/QK4NdO9qyu5SGRq4/images/playground-guardrails.png?w=1100\u0026fit=max\u0026auto=format\u0026n=QK4NdO9qyu5SGRq4\u0026q=85\u0026s=10f7b3b186f738d2880ba9f564999cb3 1100w, https://mintcdn.com/truefoundry/QK4NdO9qyu5SGRq4/images/playground-guardrails.png?w=1650\u0026fit=max\u0026auto=format\u0026n=QK4NdO9qyu5SGRq4\u0026q=85\u0026s=e026f9cf9b71f49229c68948bce5d05e 1650w, https://mintcdn.com/truefoundry/QK4NdO9qyu5SGRq4/images/playground-guardrails.png?w=2500\u0026fit=max\u0026auto=format\u0026n=QK4NdO9qyu5SGRq4\u0026q=85\u0026s=5640312520199cffbe61b4112a023a2d 2500w`})}),`\n`]}),`\n`,_jsxs(_components.li,{children:[`\n`,_jsx(_components.p,{children:_jsx(_components.strong,{children:`Test the Guardrail`})}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`Enter a prompt that would typically be flagged as unsafe or offensive.`}),`\n`,_jsx(_components.li,{children:`Send the request to the model.`}),`\n`]}),`\n`,_jsx(_components.p,{children:`You should see that the prompt is blocked by the guardrail, demonstrating that your configuration is working as expected.`}),`\n`]}),`\n`]}),_jsx(Heading,{level:`3`,id:`testing-mcp-tool-guardrails`,children:`Testing MCP Tool Guardrails`}),_jsxs(_components.p,{children:[`Once you have configured guardrail policies in `,_jsx(_components.strong,{children:`AI Gateway → Policies → Guardrails`}),`, you can test MCP Pre Tool and Post Tool guardrails from the Playground:`]}),_jsxs(_components.ol,{children:[`\n`,_jsxs(_components.li,{children:[`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Configure Guardrail Policies First`}),_jsx(_components.br,{}),`\n`,`Navigate to `,_jsx(_components.strong,{children:`AI Gateway → Policies → Guardrails`}),` and create rules that target your MCP servers/tools with guardrails on the MCP Tool Pre-Invoke or Post-Invoke hooks.`]}),`\n`]}),`\n`,_jsxs(_components.li,{children:[`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Use the Playground with MCP Tools`}),_jsx(_components.br,{}),`\n`,`In the Playground, when you invoke MCP tools (via agents or tool calls), the configured guardrails will automatically execute on the Pre Tool and Post Tool hooks.`]}),`\n`]}),`\n`,_jsxs(_components.li,{children:[`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`View Results in Traces`}),_jsx(_components.br,{}),`\n`,`After execution, navigate to `,_jsx(_components.strong,{children:`Monitor → Request Traces`}),` to see detailed information about which guardrails were triggered on each MCP tool invocation, including:`]}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`Pre Tool guardrail validation results`}),`\n`,_jsx(_components.li,{children:`Post Tool guardrail findings and mutations`}),`\n`,_jsx(_components.li,{children:`Pass/fail status for each guardrail`}),`\n`]}),`\n`]}),`\n`]}),_jsx(Tip,{children:_jsx(_components.p,{children:`Testing in the Playground is an easy way to validate that your guardrails are correctly configured before deploying to production. For MCP guardrails, use the Request Traces view to verify guardrails are triggering as expected on tool invocations.`})})]}),_jsxs(Step,{title:`Trigger Guardrails in LLM requests from code`,id:`trigger-guardrails-in-llm-requests-from-code`,children:[_jsxs(_components.p,{children:[`You can add extra guardrails on a single request with the `,_jsx(_components.code,{children:`X-TFY-GUARDRAILS`}),` header. Matching gateway policies still run. You can copy the relevant code snippet from the Playground section.`]}),_jsxs(_components.ol,{children:[`\n`,_jsxs(_components.li,{children:[`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Select the Guardrail to Apply`}),_jsx(_components.br,{}),`\n`,`On the left side, choose the `,_jsx(_components.strong,{children:`LLM Input Guardrails`}),` and `,_jsx(_components.strong,{children:`LLM Output Guardrails`}),` sections, and select the guardrails you want to apply. For this tutorial, we’ve selected the `,_jsx(_components.code,{children:`tfy-openai-moderation`}),` guardrail for both input and output.`]}),`\n`,_jsx(Frame,{caption:`Select the Guardrail to Apply`,children:_jsx(OptimizedImage,{src:`https://mintcdn.com/truefoundry/QK4NdO9qyu5SGRq4/images/playground-output-guardrails.png?fit=max\u0026auto=format\u0026n=QK4NdO9qyu5SGRq4\u0026q=85\u0026s=62d196a4d29a96c1b36535ead62e74eb`,alt:`Guardrail selector in playground showing selected OpenAI moderation guardrail`,\"data-og-width\":`1918`,width:`1918`,\"data-og-height\":`1042`,height:`1042`,\"data-path\":`images/playground-output-guardrails.png`,\"data-optimize\":`true`,\"data-opv\":`3`,srcset:`https://mintcdn.com/truefoundry/QK4NdO9qyu5SGRq4/images/playground-output-guardrails.png?w=280\u0026fit=max\u0026auto=format\u0026n=QK4NdO9qyu5SGRq4\u0026q=85\u0026s=bd7f4e384eb9dbcdb6a2c6ffd3f8a76a 280w, https://mintcdn.com/truefoundry/QK4NdO9qyu5SGRq4/images/playground-output-guardrails.png?w=560\u0026fit=max\u0026auto=format\u0026n=QK4NdO9qyu5SGRq4\u0026q=85\u0026s=3dfd772d5b42936b096908e96b6dd7ad 560w, https://mintcdn.com/truefoundry/QK4NdO9qyu5SGRq4/images/playground-output-guardrails.png?w=840\u0026fit=max\u0026auto=format\u0026n=QK4NdO9qyu5SGRq4\u0026q=85\u0026s=164b16628c84cffde16462893d7c87d8 840w, https://mintcdn.com/truefoundry/QK4NdO9qyu5SGRq4/images/playground-output-guardrails.png?w=1100\u0026fit=max\u0026auto=format\u0026n=QK4NdO9qyu5SGRq4\u0026q=85\u0026s=1c9bdc9a7150e32c2f6367ebdc0841bb 1100w, https://mintcdn.com/truefoundry/QK4NdO9qyu5SGRq4/images/playground-output-guardrails.png?w=1650\u0026fit=max\u0026auto=format\u0026n=QK4NdO9qyu5SGRq4\u0026q=85\u0026s=d872ceadd150bfd1c5e912d9ec346a76 1650w, https://mintcdn.com/truefoundry/QK4NdO9qyu5SGRq4/images/playground-output-guardrails.png?w=2500\u0026fit=max\u0026auto=format\u0026n=QK4NdO9qyu5SGRq4\u0026q=85\u0026s=eb037b70a3cd04c9cbab8f3656dba8ef 2500w`})}),`\n`]}),`\n`,_jsxs(_components.li,{children:[`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Get the Code Snippet`}),_jsx(_components.br,{}),`\n`,`After configuring your request and selecting the desired guardrail(s), click the `,_jsx(_components.strong,{children:`Code`}),` button at the top right of the Playground.`,_jsx(_components.br,{}),`\n`,`In the code snippet section, you will see ready-to-use examples for different SDKs and `,_jsx(_components.code,{children:`curl`}),`.`,_jsx(_components.br,{}),`\n`,_jsx(_components.strong,{children:`Note:`}),` The generated code will automatically include the necessary `,_jsx(_components.code,{children:`X-TFY-GUARDRAILS`}),` header with your selected guardrails.`]}),`\n`,_jsx(Frame,{caption:`Code Snippet Section`,children:_jsx(OptimizedImage,{src:`https://mintcdn.com/truefoundry/F2Zf4aiTLXb_89wL/images/guardrails-code-snippet.png?fit=max\u0026auto=format\u0026n=F2Zf4aiTLXb_89wL\u0026q=85\u0026s=d6668edebe141ea17f9bbb263c1e83d8`,alt:`Code snippet section showing language options for implementing guardrails`,\"data-og-width\":`1918`,width:`1918`,\"data-og-height\":`1038`,height:`1038`,\"data-path\":`images/guardrails-code-snippet.png`,\"data-optimize\":`true`,\"data-opv\":`3`,srcset:`https://mintcdn.com/truefoundry/F2Zf4aiTLXb_89wL/images/guardrails-code-snippet.png?w=280\u0026fit=max\u0026auto=format\u0026n=F2Zf4aiTLXb_89wL\u0026q=85\u0026s=25c98e40f47820a64415a703fefe314c 280w, https://mintcdn.com/truefoundry/F2Zf4aiTLXb_89wL/images/guardrails-code-snippet.png?w=560\u0026fit=max\u0026auto=format\u0026n=F2Zf4aiTLXb_89wL\u0026q=85\u0026s=5f3b52b968c3f56a40ab087c347cccb8 560w, https://mintcdn.com/truefoundry/F2Zf4aiTLXb_89wL/images/guardrails-code-snippet.png?w=840\u0026fit=max\u0026auto=format\u0026n=F2Zf4aiTLXb_89wL\u0026q=85\u0026s=c7124239cd607f5fb3a3d48086deb34d 840w, https://mintcdn.com/truefoundry/F2Zf4aiTLXb_89wL/images/guardrails-code-snippet.png?w=1100\u0026fit=max\u0026auto=format\u0026n=F2Zf4aiTLXb_89wL\u0026q=85\u0026s=f163c1bb513c351f7b408bc054196c19 1100w, https://mintcdn.com/truefoundry/F2Zf4aiTLXb_89wL/images/guardrails-code-snippet.png?w=1650\u0026fit=max\u0026auto=format\u0026n=F2Zf4aiTLXb_89wL\u0026q=85\u0026s=2339de01c3706f3595eccc85d2df823e 1650w, https://mintcdn.com/truefoundry/F2Zf4aiTLXb_89wL/images/guardrails-code-snippet.png?w=2500\u0026fit=max\u0026auto=format\u0026n=F2Zf4aiTLXb_89wL\u0026q=85\u0026s=80f6945c9da6b6ee4385c3508187ec88 2500w`})}),`\n`]}),`\n`,_jsxs(_components.li,{children:[`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Copy and Run the Code`}),_jsx(_components.br,{}),`\n`,`Copy the generated `,_jsx(_components.code,{children:`curl`}),` command (or code for your preferred SDK) and run it.`,_jsx(_components.br,{}),`\n`,`The guardrails you selected in the Playground will be applied automatically, as reflected in the request headers.`]}),`\n`,_jsx(Frame,{caption:`Copy the code snippet`,children:_jsx(OptimizedImage,{src:`https://mintcdn.com/truefoundry/F2Zf4aiTLXb_89wL/images/guardrails-curl-request.png?fit=max\u0026auto=format\u0026n=F2Zf4aiTLXb_89wL\u0026q=85\u0026s=36a464f805dbff165fe97854d3cea59d`,alt:`Curl command example with X-TFY-GUARDRAILS header for applying guardrails`,\"data-og-width\":`1343`,width:`1343`,\"data-og-height\":`1038`,height:`1038`,\"data-path\":`images/guardrails-curl-request.png`,\"data-optimize\":`true`,\"data-opv\":`3`,srcset:`https://mintcdn.com/truefoundry/F2Zf4aiTLXb_89wL/images/guardrails-curl-request.png?w=280\u0026fit=max\u0026auto=format\u0026n=F2Zf4aiTLXb_89wL\u0026q=85\u0026s=07983d084ce769b98255f4fb11c42d34 280w, https://mintcdn.com/truefoundry/F2Zf4aiTLXb_89wL/images/guardrails-curl-request.png?w=560\u0026fit=max\u0026auto=format\u0026n=F2Zf4aiTLXb_89wL\u0026q=85\u0026s=2323628490f6839ace25bd88e452e969 560w, https://mintcdn.com/truefoundry/F2Zf4aiTLXb_89wL/images/guardrails-curl-request.png?w=840\u0026fit=max\u0026auto=format\u0026n=F2Zf4aiTLXb_89wL\u0026q=85\u0026s=467c8327e82709c1c2067b353e98e376 840w, https://mintcdn.com/truefoundry/F2Zf4aiTLXb_89wL/images/guardrails-curl-request.png?w=1100\u0026fit=max\u0026auto=format\u0026n=F2Zf4aiTLXb_89wL\u0026q=85\u0026s=92744b16cf65638df809950b33db5991 1100w, https://mintcdn.com/truefoundry/F2Zf4aiTLXb_89wL/images/guardrails-curl-request.png?w=1650\u0026fit=max\u0026auto=format\u0026n=F2Zf4aiTLXb_89wL\u0026q=85\u0026s=07621f22c8f11e3543e05fe256e5c20f 1650w, https://mintcdn.com/truefoundry/F2Zf4aiTLXb_89wL/images/guardrails-curl-request.png?w=2500\u0026fit=max\u0026auto=format\u0026n=F2Zf4aiTLXb_89wL\u0026q=85\u0026s=ce541b6c78b446f14ee251d563577d3f 2500w`})}),`\n`]}),`\n`]}),_jsx(Heading,{level:`3`,id:`x-tfy-guardrails-header-format`,children:`X-TFY-GUARDRAILS Header Format`}),_jsx(_components.p,{children:`The header accepts JSON with the following fields:`}),_jsx(CodeBlock,{filename:``,numberOfLines:`4`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`4`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` \"llm_input_guardrails\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: [`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"group/guardrail-name\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`],`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` \"llm_output_guardrails\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: [`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"group/guardrail-name\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`]`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Field`}),_jsx(_components.th,{children:`Type`}),_jsx(_components.th,{children:`Description`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`llm_input_guardrails`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`string[]`})}),_jsx(_components.td,{children:`Guardrails to run on the LLM input (prompt)`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`llm_output_guardrails`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`string[]`})}),_jsx(_components.td,{children:`Guardrails to run on the LLM output (response)`})]})]})]}),_jsx(Tip,{children:_jsxs(_components.p,{children:[`Add the `,_jsx(_components.code,{children:`X-TFY-GUARDRAILS`}),` header from any HTTP client or SDK. It adds those guardrails for this request only. Matching gateway policies still run.`]})}),_jsx(Note,{children:_jsxs(_components.p,{children:[`For backward compatibility, `,_jsx(_components.code,{children:`input_guardrails`}),` maps to `,_jsx(_components.code,{children:`llm_input_guardrails`}),` and `,_jsx(_components.code,{children:`output_guardrails`}),` maps to `,_jsx(_components.code,{children:`llm_output_guardrails`}),`.`]})})]}),_jsxs(Step,{title:`Configure guardrail policies at gateway layer`,id:`configure-guardrail-policies-at-gateway-layer`,children:[_jsx(_components.p,{children:`Registering a guardrail integration doesn’t apply it to any traffic by itself — you also need a guardrail policy that defines when to apply which guardrails.`}),_jsxs(_components.ol,{children:[`\n`,_jsxs(_components.li,{children:[`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Navigate to Guardrail Policies`}),_jsx(_components.br,{}),`\n`,`Go to `,_jsx(_components.strong,{children:`AI Gateway → Policies → Guardrails`}),` to access the Guardrail Policies page.`]}),`\n`]}),`\n`,_jsxs(_components.li,{children:[`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Create a Guardrail Rule`}),_jsx(_components.br,{}),`\n`,`Click `,_jsx(_components.strong,{children:`Add New Guardrail Rule`}),`, set a unique `,_jsx(_components.strong,{children:`Configuration Name`}),`, and fill in the form:`]}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`Under `,_jsx(_components.strong,{children:`When Request Goes To`}),`, target specific models or MCP servers`]}),`\n`,_jsxs(_components.li,{children:[`Under `,_jsx(_components.strong,{children:`From Subjects`}),`, filter by the users, teams, or virtual accounts making the request`]}),`\n`,_jsxs(_components.li,{children:[`Under `,_jsx(_components.strong,{children:`Apply on Hooks`}),`, attach your registered guardrails to any of the four hooks:`,`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`LLM Input`}),` - Before LLM request`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`LLM Output`}),` - After LLM response`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`MCP Tool Pre-Invoke`}),` - Before MCP tool invocation`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`MCP Tool Post-Invoke`}),` - After MCP tool returns`]}),`\n`]}),`\n`]}),`\n`]}),`\n`]}),`\n`,_jsxs(_components.li,{children:[`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Submit the Rule`}),_jsx(_components.br,{}),`\n`,`After filling out the form, click `,_jsx(_components.strong,{children:`Submit`}),` to save this named policy (each rule is its own `,_jsx(_components.code,{children:`gateway-guardrails-config`}),`).`]}),`\n`]}),`\n`]}),_jsx(Frame,{caption:`Guardrail policy rule targeting models and MCP servers with guardrails applied on hooks`,children:_jsx(OptimizedImage,{src:`https://mintcdn.com/truefoundry/F2Zf4aiTLXb_89wL/images/guardrails-policies.png?fit=max\u0026auto=format\u0026n=F2Zf4aiTLXb_89wL\u0026q=85\u0026s=6fe71d78c55f74d219976cb82a901d1d`,alt:`Guardrail rule editor in AI Gateway Policies showing targets, subjects, hooks, and custom error message fields`,\"data-og-width\":`1918`,width:`1918`,\"data-og-height\":`1039`,height:`1039`,\"data-path\":`images/guardrails-policies.png`,\"data-optimize\":`true`,\"data-opv\":`3`,srcset:`https://mintcdn.com/truefoundry/F2Zf4aiTLXb_89wL/images/guardrails-policies.png?w=280\u0026fit=max\u0026auto=format\u0026n=F2Zf4aiTLXb_89wL\u0026q=85\u0026s=5b99d735c801509ac3bbb7b6bc2bee78 280w, https://mintcdn.com/truefoundry/F2Zf4aiTLXb_89wL/images/guardrails-policies.png?w=560\u0026fit=max\u0026auto=format\u0026n=F2Zf4aiTLXb_89wL\u0026q=85\u0026s=62cd556e41fbf2a658a73e26b917233b 560w, https://mintcdn.com/truefoundry/F2Zf4aiTLXb_89wL/images/guardrails-policies.png?w=840\u0026fit=max\u0026auto=format\u0026n=F2Zf4aiTLXb_89wL\u0026q=85\u0026s=c1269f63ca46a16a43914cddf3e36921 840w, https://mintcdn.com/truefoundry/F2Zf4aiTLXb_89wL/images/guardrails-policies.png?w=1100\u0026fit=max\u0026auto=format\u0026n=F2Zf4aiTLXb_89wL\u0026q=85\u0026s=3c571a31263f6cba8f3349fb8ca36108 1100w, https://mintcdn.com/truefoundry/F2Zf4aiTLXb_89wL/images/guardrails-policies.png?w=1650\u0026fit=max\u0026auto=format\u0026n=F2Zf4aiTLXb_89wL\u0026q=85\u0026s=387fbe7afb58dd7bf2bfded332cd6617 1650w, https://mintcdn.com/truefoundry/F2Zf4aiTLXb_89wL/images/guardrails-policies.png?w=2500\u0026fit=max\u0026auto=format\u0026n=F2Zf4aiTLXb_89wL\u0026q=85\u0026s=2e4775950cdd7369033e9f0d1ea361a7 2500w`})}),_jsxs(_components.p,{children:[`For more details on how to configure guardrail policies, including custom error messages and YAML configuration, see `,_jsx(_components.a,{href:`/docs/ai-gateway/guardrails-configuration`,children:`Configure Guardrail Policies`}),`.`]}),_jsx(Tip,{children:_jsx(_components.p,{children:`Configuring guardrails at the AI Gateway layer is recommended for organization-wide enforcement. This centralizes guardrail management and auditing, eliminating the need to set headers on every request. MCP tool guardrails are especially important for securing agentic workflows.`})})]}),_jsxs(Step,{title:`Monitor Guardrail Execution`,id:`monitor-guardrail-execution`,children:[_jsx(_components.p,{children:`After configuring guardrails, you can verify they are being applied correctly by monitoring execution in real-time through the AI Gateway dashboard:`}),_jsxs(_components.ol,{children:[`\n`,_jsxs(_components.li,{children:[`Navigate to `,_jsx(_components.strong,{children:`AI Gateway → Monitor → Request Traces`})]}),`\n`,_jsx(_components.li,{children:`View detailed traces showing which guardrails were triggered on each hook`}),`\n`,_jsx(_components.li,{children:`See findings, mutations, and execution timing for each guardrail`}),`\n`,_jsx(_components.li,{children:`Filter by guardrail status to quickly find blocked or flagged requests`}),`\n`]}),_jsx(Frame,{caption:`Guardrail latency visible in Request Traces`,children:_jsx(OptimizedImage,{src:`https://mintcdn.com/truefoundry/r1of9DsUNzanZ7Rp/images/trace-guardrail.png?fit=max\u0026auto=format\u0026n=r1of9DsUNzanZ7Rp\u0026q=85\u0026s=a0b4bd00c9da0eb3ca2ab1263414fd18`,alt:`Request Traces view showing a selected Guardrail span with latency, result, scope, input, and output details`,\"data-og-width\":`1918`,width:`1918`,\"data-og-height\":`1035`,height:`1035`,\"data-path\":`images/trace-guardrail.png`,\"data-optimize\":`true`,\"data-opv\":`3`,srcset:`https://mintcdn.com/truefoundry/r1of9DsUNzanZ7Rp/images/trace-guardrail.png?w=280\u0026fit=max\u0026auto=format\u0026n=r1of9DsUNzanZ7Rp\u0026q=85\u0026s=617fe41d42c210653206b99da2b8bd6d 280w, https://mintcdn.com/truefoundry/r1of9DsUNzanZ7Rp/images/trace-guardrail.png?w=560\u0026fit=max\u0026auto=format\u0026n=r1of9DsUNzanZ7Rp\u0026q=85\u0026s=7a814b0add0ad5c6eb749b466bf03f49 560w, https://mintcdn.com/truefoundry/r1of9DsUNzanZ7Rp/images/trace-guardrail.png?w=840\u0026fit=max\u0026auto=format\u0026n=r1of9DsUNzanZ7Rp\u0026q=85\u0026s=ad4784469d16d2ee2896918aa31ae0e9 840w, https://mintcdn.com/truefoundry/r1of9DsUNzanZ7Rp/images/trace-guardrail.png?w=1100\u0026fit=max\u0026auto=format\u0026n=r1of9DsUNzanZ7Rp\u0026q=85\u0026s=d96c984e071f9539f075efcc1bed2fad 1100w, https://mintcdn.com/truefoundry/r1of9DsUNzanZ7Rp/images/trace-guardrail.png?w=1650\u0026fit=max\u0026auto=format\u0026n=r1of9DsUNzanZ7Rp\u0026q=85\u0026s=22ea1c30b3e1b026645396a68d89e757 1650w, https://mintcdn.com/truefoundry/r1of9DsUNzanZ7Rp/images/trace-guardrail.png?w=2500\u0026fit=max\u0026auto=format\u0026n=r1of9DsUNzanZ7Rp\u0026q=85\u0026s=bfc2ee86f2ee57496426ddea6efcfeeb 2500w`})}),_jsx(Tip,{children:_jsx(_components.p,{children:`Use the Request Traces view to debug guardrail behavior, identify false positives during audit mode rollout, and verify your configuration is working as expected.`})})]}),_jsxs(Step,{title:`Detect Guardrail Violations Programmatically`,id:`detect-guardrail-violations-programmatically`,children:[_jsxs(_components.p,{children:[`When a guardrail blocks a request, the AI Gateway returns a `,_jsx(_components.code,{children:`400`}),` status code with `,_jsx(_components.code,{children:`error.type`}),` set to `,_jsx(_components.code,{children:`guardrail_checks_failed`}),`. You can use this to handle violations in your application.`]}),_jsx(CodeBlock,{filename:``,numberOfLines:`25`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`25`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` openai `}),_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` OpenAI`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`client = OpenAI(`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` api_key`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"your_truefoundry_api_key\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` base_url`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`{GATEWAY_BASE_URL}`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`)`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`try`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` response = client.chat.completions.create(`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` model`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"openai-main/gpt-4o-mini\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` messages`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=[`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` {`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"role\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"user\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"content\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"How do I write a function to calculate factorial?\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`}`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` ]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` )`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:` print`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"Response:\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, response.choices[`}),_jsx(_components.span,{style:{color:`#B5CEA8`,\"--shiki-dark\":`#B5CEA8`},children:`0`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`].message.content)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`except`}),_jsx(_components.span,{style:{color:`#4EC9B0`,\"--shiki-dark\":`#4EC9B0`},children:` Exception`}),_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:` as`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` e:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:` if`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:` hasattr`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(e, `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`'response'`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`and`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` e.response `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`is`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` not`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` None`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` error_data = e.response.json()`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:` if`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` error_data.get(`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`'error'`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, {}).get(`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`'type'`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`) == `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`'guardrail_checks_failed'`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:` print`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"Guardrail violation detected!\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` checks = error_data.get(`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`'guardrail_checks'`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, {})`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:` for`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` hook `}),_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`in`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` [`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`'llm_input_guardrails'`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`'llm_output_guardrails'`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` 'mcp_tool_pre_invoke_guardrails'`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`'mcp_tool_post_invoke_guardrails'`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`]:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:` if`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` checks.get(hook):`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:` print`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`f`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"Violation on: `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`{`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`hook`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`]})})}),_jsx(Note,{children:_jsxs(_components.p,{children:[`The `,_jsx(_components.code,{children:`guardrail_checks`}),` object in the error response only contains the hooks that were evaluated for the request.`]})})]})]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"codeStyling":"dark","config":{},"pageMetadata":{"title":"AI Gateway Guardrails: Quick Start","sidebarTitle":"Getting Started","description":"Learn how to set up and implement guardrails to ensure safe and compliant LLM interactions and MCP tool invocations.","href":"/docs/ai-gateway/guardrails-getting-started"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Create a Guardrails Group","slug":"create-a-guardrails-group","depth":3,"children":[]},{"title":"Add Guardrail Integration in Guardrails Group","slug":"add-guardrail-integration-in-guardrails-group","depth":3,"children":[]},{"title":"Test Guardrails in Playground","slug":"test-guardrails-in-playground","depth":3,"children":[]},{"title":"Testing LLM Input/Output Guardrails","slug":"testing-llm-input/output-guardrails","depth":3,"children":[]},{"title":"Testing MCP Tool Guardrails","slug":"testing-mcp-tool-guardrails","depth":3,"children":[]},{"title":"Trigger Guardrails in LLM requests from code","slug":"trigger-guardrails-in-llm-requests-from-code","depth":3,"children":[]},{"title":"X-TFY-GUARDRAILS Header Format","slug":"x-tfy-guardrails-header-format","depth":3,"children":[]},{"title":"Configure guardrail policies at gateway layer","slug":"configure-guardrail-policies-at-gateway-layer","depth":3,"children":[]},{"title":"Monitor Guardrail Execution","slug":"monitor-guardrail-execution","depth":3,"children":[]},{"title":"Detect Guardrail Violations Programmatically","slug":"detect-guardrail-violations-programmatically","depth":3,"children":[]}],"codeExamples":{}},"jsLinks":["/_mintlify/custom/truefoundry/9e0085f7ed271180/scripts.js"],"subdomain":"truefoundry","siteName":"TrueFoundry Docs","title":"AI Gateway Guardrails: Quick Start - TrueFoundry Docs","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-10-23T19:22:20.750Z","originalFileLocation":"docs/ai-gateway/guardrails-getting-started.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"light\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Learn how to set up and implement guardrails to ensure safe and compliant LLM interactions and MCP tool invocations.\">\u003cmeta data-mint-head name=\"application-name\" content=\"TrueFoundry Docs\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/truefoundry/DMuq4kzeTciVEGUc/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/truefoundry/DMuq4kzeTciVEGUc/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/truefoundry/DMuq4kzeTciVEGUc/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/truefoundry/DMuq4kzeTciVEGUc/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/truefoundry/DMuq4kzeTciVEGUc/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/truefoundry/DMuq4kzeTciVEGUc/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/truefoundry/DMuq4kzeTciVEGUc/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/truefoundry/DMuq4kzeTciVEGUc/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/truefoundry/DMuq4kzeTciVEGUc/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"AI Gateway Guardrails: Quick Start - TrueFoundry Docs\">\u003cmeta data-mint-head property=\"og:description\" content=\"TrueFoundry offers an enterprise-grade AI Gateway combining LLM, MCP, and Agent Gateways—empowering businesses to connect, monitor, and govern agentic AI applications across providers from a unified control plane.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"TrueFoundry Docs\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://www.truefoundry.com/docs/ai-gateway/guardrails-getting-started\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://assets.production.truefoundry.com/logo.svg\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"AI Gateway Guardrails: Quick Start - TrueFoundry Docs\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"TrueFoundry offers an enterprise-grade AI Gateway combining LLM, MCP, and Agent Gateways—empowering businesses to connect, monitor, and govern agentic AI applications across providers from a unified control plane.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://assets.production.truefoundry.com/logo.svg\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/truefoundry/DMuq4kzeTciVEGUc/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"TrueFoundry Docs\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#4f46e5\">\u003clink data-mint-head rel=\"canonical\" href=\"https://www.truefoundry.com/docs/ai-gateway/guardrails-getting-started\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/docs/ai-gateway/guardrails-getting-started.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://www.truefoundry.com/#organization\",\"name\":\"TrueFoundry Docs\",\"url\":\"https://www.truefoundry.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/truefoundry/e2uUimEwX30qkWxc/logo/light.svg?fit=max\u0026auto=format\u0026n=e2uUimEwX30qkWxc\u0026q=85\u0026s=6068d83664aeda0239bec2422657dd20\"}},{\"@type\":\"WebSite\",\"@id\":\"https://www.truefoundry.com#website\",\"name\":\"TrueFoundry Docs\",\"url\":\"https://www.truefoundry.com\",\"publisher\":{\"@id\":\"https://www.truefoundry.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://www.truefoundry.com/docs/ai-gateway/guardrails-getting-started#webpage\",\"url\":\"https://www.truefoundry.com/docs/ai-gateway/guardrails-getting-started\",\"name\":\"AI Gateway Guardrails: Quick Start\",\"description\":\"Learn how to set up and implement guardrails to ensure safe and compliant LLM interactions and MCP tool invocations.\",\"dateModified\":\"2026-10-23T19:22:20.750Z\",\"isPartOf\":{\"@id\":\"https://www.truefoundry.com#website\"},\"breadcrumb\":{\"@id\":\"https://www.truefoundry.com/docs/ai-gateway/guardrails-getting-started#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://www.truefoundry.com/docs/ai-gateway/guardrails-getting-started#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Guardrails and Security\",\"item\":\"https://www.truefoundry.com/docs/ai-gateway/guardrails-overview\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"AI Gateway Guardrails: Quick Start\",\"item\":\"https://www.truefoundry.com/docs/ai-gateway/guardrails-getting-started\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://www.truefoundry.com/docs/ai-gateway/guardrails-getting-started#article\",\"headline\":\"AI Gateway Guardrails: Quick Start\",\"name\":\"AI Gateway Guardrails: Quick Start\",\"description\":\"Learn how to set up and implement guardrails to ensure safe and compliant LLM interactions and MCP tool invocations.\",\"url\":\"https://www.truefoundry.com/docs/ai-gateway/guardrails-getting-started\",\"mainEntityOfPage\":{\"@id\":\"https://www.truefoundry.com/docs/ai-gateway/guardrails-getting-started#webpage\"},\"image\":\"https://assets.production.truefoundry.com/logo.svg\",\"dateModified\":\"2026-10-23T19:22:20.750Z\",\"publisher\":{\"@id\":\"https://www.truefoundry.com/#organization\"},\"isPartOf\":{\"@id\":\"https://www.truefoundry.com#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"TrueFoundry Docs\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"TrueFoundry Docs\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/docs/ai-gateway/guardrails-getting-started.md","siteName":"TrueFoundry Docs","nav":{"global":null,"tabs":[{"tab":"AI Gateway","groups":[{"group":"Get Started","pages":[{"title":"Introduction to AI Gateway","sidebarTitle":"AI Gateway Overview","href":"/docs/ai-gateway/intro-to-llm-gateway"},{"title":"Quick Start Guide: Setup \u0026 Integration","sidebarTitle":"Quick Start","href":"/docs/ai-gateway/quick-start"}]},{"group":"LLM Gateway","pages":[{"group":"Integrate Models","pages":[{"title":"TrueFoundry Managed Models","sidebarTitle":"TrueFoundry Managed Models","href":"/docs/ai-gateway/truefoundry-managed"},{"title":"Providers","sidebarTitle":"Supported Providers","href":"/docs/ai-gateway/supported-providers"},{"title":"OpenAI","sidebarTitle":"OpenAI Models","href":"/docs/ai-gateway/openai"},{"title":"Anthropic","sidebarTitle":"Anthropic","href":"/docs/ai-gateway/anthropic"},{"title":"AWS Claude Platform","sidebarTitle":"AWS Claude Platform","href":"/docs/ai-gateway/aws-claude-platform"},{"title":"AWS Bedrock","sidebarTitle":"AWS Bedrock","href":"/docs/ai-gateway/aws-bedrock"},{"title":"AWS Bedrock Mantle","sidebarTitle":"AWS Bedrock Mantle","href":"/docs/ai-gateway/aws-bedrock-mantle"},{"title":"AWS Sagemaker","sidebarTitle":"AWS Sagemaker","href":"/docs/ai-gateway/aws-sagemaker"},{"title":"Google Vertex","sidebarTitle":"Google Vertex AI","href":"/docs/ai-gateway/google-vertex"},{"title":"Google Gemini","sidebarTitle":"Google Gemini","href":"/docs/ai-gateway/google-gemini"},{"group":"Azure Models","pages":[{"title":"Choosing an Azure model integration","sidebarTitle":"Overview","href":"/docs/ai-gateway/azure-models-guide"},{"title":"Microsoft Foundry","sidebarTitle":"Microsoft Foundry","tag":"NEW","href":"/docs/ai-gateway/microsoft-foundry"},{"title":"Migrate to Microsoft Foundry","sidebarTitle":"Migrate to Microsoft Foundry","href":"/docs/ai-gateway/migrate-to-microsoft-foundry"},{"title":"Azure OpenAI","sidebarTitle":"Azure OpenAI","tag":"LEGACY","href":"/docs/ai-gateway/azure-openai"},{"title":"Azure Foundry","sidebarTitle":"Azure AI Foundry","tag":"LEGACY","href":"/docs/ai-gateway/azure-ai-foundry"},{"group":"Authentication","pages":[{"title":"Azure Entra ID Certificate Based Authentication","sidebarTitle":"Azure Certificate Auth","href":"/docs/ai-gateway/azure-entra-certificate-auth"},{"title":"Azure Entra ID Client Secret Based Authentication","sidebarTitle":"Azure Client Secret Auth","href":"/docs/ai-gateway/azure-entra-client-secret-auth"},{"title":"Azure Workload Identity Federation Authentication","sidebarTitle":"Azure Workload Identity","href":"/docs/ai-gateway/azure-entra-wif-auth"}]}]},{"title":"Databricks","sidebarTitle":"Databricks Models","href":"/docs/ai-gateway/databricks-models"},{"title":"Cohere","sidebarTitle":"Cohere Models","href":"/docs/ai-gateway/cohere"},{"title":"AI21","sidebarTitle":"AI21","href":"/docs/ai-gateway/ai21"},{"title":"Deepinfra","sidebarTitle":"Deepinfra Models","href":"/docs/ai-gateway/deepinfra"},{"title":"Groq","sidebarTitle":"Groq Models","href":"/docs/ai-gateway/groq"},{"title":"ElevenLabs","sidebarTitle":"ElevenLabs","href":"/docs/ai-gateway/elevenlabs"},{"title":"Deepgram","sidebarTitle":"Deepgram","href":"/docs/ai-gateway/deepgram"},{"title":"Cartesia","sidebarTitle":"Cartesia","href":"/docs/ai-gateway/cartesia"},{"title":"Smallest AI","sidebarTitle":"Smallest AI","href":"/docs/ai-gateway/smallest-ai"},{"title":"Mistral AI","sidebarTitle":"Mistral AI Models","href":"/docs/ai-gateway/mistral"},{"title":"Cloudera","sidebarTitle":"Cloudera Models","href":"/docs/ai-gateway/cloudera"},{"title":"OpenRouter","sidebarTitle":"OpenRouter","href":"/docs/ai-gateway/openrouter"},{"title":"Perplexity AI","sidebarTitle":"Perplexity Models","href":"/docs/ai-gateway/perplexity-ai"},{"title":"Together AI","sidebarTitle":"Together AI","href":"/docs/ai-gateway/together-ai"},{"title":"xAI","sidebarTitle":"xAI Models","href":"/docs/ai-gateway/xai"},{"title":"SambaNova","sidebarTitle":"SambaNova","href":"/docs/ai-gateway/sambanova"},{"title":"Cerebras","sidebarTitle":"Cerebras","href":"/docs/ai-gateway/cerebras"},{"title":"Wafer","sidebarTitle":"Wafer","href":"/docs/ai-gateway/wafer"},{"title":"Fireworks AI Model Provider for TrueFoundry AI Gateway","sidebarTitle":"Fireworks AI","href":"/docs/ai-gateway/fireworks-ai"},{"title":"Snowflake Cortex","sidebarTitle":"Snowflake Cortex","href":"/docs/ai-gateway/snowflake-cortex"},{"title":"Baseten","sidebarTitle":"Baseten","href":"/docs/ai-gateway/baseten"},{"title":"TypeSafe","sidebarTitle":"TypeSafe","href":"/docs/ai-gateway/typesafe"},{"group":"Custom Endpoints","root":{"title":"Custom Endpoints","sidebarTitle":"Custom Endpoints","href":"/docs/ai-gateway/custom-endpoints"},"expanded":false,"pages":[{"group":"Examples","pages":[{"title":"CoreWeave","sidebarTitle":"CoreWeave Models","href":"/docs/ai-gateway/coreweave-models"},{"title":"PipeShift","sidebarTitle":"PipeShift","href":"/docs/ai-gateway/pipeshift"},{"title":"SiliconFlow","sidebarTitle":"SiliconFlow","href":"/docs/ai-gateway/siliconflow"},{"title":"io.net","sidebarTitle":"io.net","href":"/docs/ai-gateway/io-net"},{"title":"Resemble AI","sidebarTitle":"Resemble AI","href":"/docs/ai-gateway/resemble-ai"},{"title":"Ringg.AI","sidebarTitle":"Ringg.AI","href":"/docs/ai-gateway/ringg-ai"},{"title":"Crusoe","sidebarTitle":"Crusoe","href":"/docs/ai-gateway/crusoe"},{"title":"Jev (TypeSafe)","sidebarTitle":"Jev","href":"/docs/ai-gateway/jev"},{"title":"SCX.ai","sidebarTitle":"SCX.ai","href":"/docs/ai-gateway/scx-ai"}]}]},{"title":"Self-Hosted Models","sidebarTitle":"Self-Hosted Models","href":"/docs/ai-gateway/self-hosted-models"}]},{"group":"Supported APIs","pages":[{"group":"Chat Completions","root":{"title":"Chat Completions API (/chat/completions)","sidebarTitle":"Overview","href":"/docs/ai-gateway/chat-completions-overview"},"expanded":false,"directory":"accordion","pages":[{"title":"Chat Completions API (/chat/completions)","sidebarTitle":"Overview","href":"/docs/ai-gateway/chat-completions-overview"},{"title":"Chat Completions: Multimodal","sidebarTitle":"Multimodal","href":"/docs/ai-gateway/chat-completions-multimodal"},{"title":"Chat Completions: Tools \u0026 Signatures","sidebarTitle":"Tools","href":"/docs/ai-gateway/chat-completions-tools"},{"title":"Chat Completions: Structured Outputs","sidebarTitle":"Structured Outputs","href":"/docs/ai-gateway/chat-completions-structured-outputs"},{"title":"Chat Completions: Caching \u0026 Reasoning","sidebarTitle":"Caching \u0026 Reasoning","href":"/docs/ai-gateway/chat-completions-advanced"},{"title":"Chat Completions: Extended Thinking","sidebarTitle":"Extended Thinking","href":"/docs/ai-gateway/chat-completions-extended-thinking"}]},{"title":"Embeddings API (/embeddings)","sidebarTitle":"Embeddings","href":"/docs/ai-gateway/embed"},{"title":"Batch API (/batches)","sidebarTitle":"Batch Predictions","href":"/docs/ai-gateway/batch-predictions-with-truefoundry-llm-gateway"},{"title":"Finetune API (/fine_tuning)","sidebarTitle":"Finetuning","href":"/docs/ai-gateway/finetune"},{"title":"Responses API (/responses)","sidebarTitle":"Responses API","href":"/docs/ai-gateway/responses-api"},{"title":"Image Generation API (/images/generations)","sidebarTitle":"Image Generation","href":"/docs/ai-gateway/image-generation"},{"title":"Image Edit API (/images/edits)","sidebarTitle":"Image Edit","href":"/docs/ai-gateway/image-edit"},{"title":"Image Variation API (/images/variations)","sidebarTitle":"Image Variation","href":"/docs/ai-gateway/image-variation"},{"title":"Video Generation API (/videos-proxy)","sidebarTitle":"Video Generation","href":"/docs/ai-gateway/video-generation"},{"title":"Text to Speech API","sidebarTitle":"Text to Speech","href":"/docs/ai-gateway/text-to-speech"},{"title":"Audio Translation API","sidebarTitle":"Audio Translation","href":"/docs/ai-gateway/audio-translation"},{"title":"Speech to Text API","sidebarTitle":"Speech to Text","href":"/docs/ai-gateway/audio-transcription"},{"group":"Live / Realtime API","root":{"title":"Live / Realtime API (/live)","sidebarTitle":"Overview","href":"/docs/ai-gateway/live-api"},"expanded":false,"directory":"accordion","pages":[{"title":"Live / Realtime API (/live)","sidebarTitle":"Overview","href":"/docs/ai-gateway/live-api"},{"title":"Live API: Code Snippets","sidebarTitle":"Code Snippets","href":"/docs/ai-gateway/live-api-code-snippets"},{"title":"Live API: Tool Calling","sidebarTitle":"Tool Calling","href":"/docs/ai-gateway/live-api-tool-calling"},{"title":"OpenAI Realtime with WebRTC","sidebarTitle":"WebRTC (OpenAI)","href":"/docs/ai-gateway/live-api-webrtc"},{"title":"Amazon Nova Sonic (Bedrock)","sidebarTitle":"Nova Sonic (Bedrock)","href":"/docs/ai-gateway/live-api-nova-sonic"}]},{"title":"Files API (/files)","sidebarTitle":"Files API","href":"/docs/ai-gateway/file-endpoints"},{"title":"Rerank API (/rerank)","sidebarTitle":"Rerank API","href":"/docs/ai-gateway/rerank"},{"title":"Moderation API (/moderations)","sidebarTitle":"Moderation API","href":"/docs/ai-gateway/moderation"},{"title":"Compaction API (/responses/compact)","sidebarTitle":"Compaction API","href":"/docs/ai-gateway/compaction"},{"title":"Messages API (/messages)","sidebarTitle":"Messages API","href":"/docs/ai-gateway/messages-overview"},{"title":"Decisions API (/v1/decisions, /v1/systemone)","sidebarTitle":"Decisions API","href":"/docs/ai-gateway/decisions"},{"title":"Proxy API (/proxy)","sidebarTitle":"Proxy API","href":"/docs/ai-gateway/proxy-api"}]},{"group":"Making LLM Requests","pages":[{"title":"Making Your First Request","sidebarTitle":"Making Your First Request","href":"/docs/ai-gateway/making-llm-requests-via-gateway"},{"title":"Authentication","sidebarTitle":"Authentication","href":"/docs/ai-gateway/authentication"},{"title":"Custom Metadata and Headers","sidebarTitle":"Metadata \u0026 Headers","href":"/docs/ai-gateway/request-headers"},{"title":"Native SDK Support","sidebarTitle":"Native SDK Support","href":"/docs/ai-gateway/native-sdk-support"},{"title":"Model Discovery","sidebarTitle":"Model Discovery","href":"/docs/ai-gateway/model-discovery"}]},{"title":"TrueFoundry AI Gateway Playground","sidebarTitle":"AI Gateway Playground","href":"/docs/ai-gateway/playground-overview"},{"group":"Virtual Models","pages":[{"title":"Virtual Models","sidebarTitle":"Overview","href":"/docs/ai-gateway/virtual-model"},{"title":"Create a Virtual Model","sidebarTitle":"Create a Virtual Model","href":"/docs/ai-gateway/virtual-model-advanced"},{"title":"Auto Routing","sidebarTitle":"Auto Routing","href":"/docs/ai-gateway/auto-routing"}]},{"title":"Access Control","sidebarTitle":"Access Control","href":"/docs/ai-gateway/gateway-access-control"},{"group":"Policies","pages":[{"title":"Rate Limiting","sidebarTitle":"Rate Limiting","href":"/docs/ai-gateway/ratelimiting-v2"},{"title":"Rate Limiting (V1, deprecated)","sidebarTitle":"Rate Limiting (V1)","hidden":true,"href":"/docs/ai-gateway/ratelimiting"},{"title":"Budget Limiting","sidebarTitle":"Budget Limiting","href":"/docs/ai-gateway/budget-limiting-v2"},{"title":"Budget Usage Recovery","sidebarTitle":"Budget Usage Recovery","href":"/docs/ai-gateway/budget-usage-recovery"},{"title":"Budget Limiting (V1, deprecated)","sidebarTitle":"Budget Limiting (V1)","hidden":true,"href":"/docs/ai-gateway/budgetlimiting"},{"title":"Logging Configuration","sidebarTitle":"Logging Config","href":"/docs/ai-gateway/logging-config"}]},{"title":"Caching (Exact and Semantic)","sidebarTitle":"Caching (Exact and Semantic)","href":"/docs/ai-gateway/caching"},{"title":"Cost Tracking","sidebarTitle":"Cost Tracking","href":"/docs/ai-gateway/cost-tracking"},{"title":"Cost Savings","sidebarTitle":"Cost Savings","href":"/docs/ai-gateway/cost-savings"},{"group":"Extras","pages":[{"title":"Session Management","sidebarTitle":"Session Management","href":"/docs/ai-gateway/session-management"},{"title":"Log Feedback on Requests","sidebarTitle":"Log Feedback","href":"/docs/ai-gateway/feedback-for-traces"},{"title":"First Chunk Gate for Streaming","sidebarTitle":"First Chunk Gate","href":"/docs/ai-gateway/first-chunk-gate"},{"title":"Anthropic Stream Overload Fallback","sidebarTitle":"Anthropic Stream Fallback","href":"/docs/ai-gateway/anthropic-stream-overload-fallback"}]}]},{"group":"MCP Registry and Gateway","pages":[{"title":"TrueFoundry MCP Gateway","sidebarTitle":"Overview","href":"/docs/ai-gateway/mcp/mcp-overview"},{"title":"MCP Server: Getting Started","sidebarTitle":"Getting Started","href":"/docs/ai-gateway/mcp/mcp-server-getting-started"},{"title":"MCP Protocol Support","sidebarTitle":"Protocol Support","href":"/docs/ai-gateway/mcp/mcp-protocol-support"},{"group":"Authentication and Security","root":{"title":"Authentication and Security","sidebarTitle":"Authentication and Security","href":"/docs/ai-gateway/mcp/mcp-gateway-auth-security"},"pages":[{"title":"Authentication and Security","sidebarTitle":"Authentication and Security","href":"/docs/ai-gateway/mcp/mcp-gateway-auth-security"},{"title":"Auth Overrides","sidebarTitle":"Auth Overrides","href":"/docs/ai-gateway/mcp/mcp-server-auth-overrides"},{"group":"Outbound auth integrations","pages":[{"title":"Okta app setup","sidebarTitle":"Okta App Setup","href":"/docs/ai-gateway/mcp/okta-app-setup"},{"title":"Microsoft Entra app setup","sidebarTitle":"Microsoft Entra App Setup","href":"/docs/ai-gateway/mcp/entra-app-setup"},{"title":"Microsoft Entra On-Behalf-Of (OBO) for MCP","sidebarTitle":"Microsoft Entra OBO App Setup","href":"/docs/ai-gateway/mcp/mcp-server-oauth-azure-obo"},{"title":"Register an AWS Bedrock AgentCore MCP Server","sidebarTitle":"AgentCore (AWS SigV4)","href":"/docs/ai-gateway/mcp/mcp-server-agentcore-sigv4"}]}]},{"title":"MCP Troubleshooting Guide","sidebarTitle":"Troubleshooting Guide","href":"/docs/ai-gateway/mcp/mcp-troubleshooting-guide"},{"title":"MCP Tool Approvals","sidebarTitle":"Tool Approvals","href":"/docs/ai-gateway/mcp/mcp-tool-approval"},{"title":"MCP Tool Management","sidebarTitle":"Tool Management","href":"/docs/ai-gateway/mcp/mcp-tool-management"},{"title":"Connect MCP Servers from Your IDE","sidebarTitle":"Connect MCP Servers from Your IDE","href":"/docs/ai-gateway/mcp/connect-mcp-from-ide"},{"title":"TrueFoundry Managed MCPs","sidebarTitle":"TrueFoundry Managed MCPs","href":"/docs/ai-gateway/mcp/tfy-managed-mcp-server"},{"title":"Virtual MCP Server","sidebarTitle":"Virtual MCP Server","href":"/docs/ai-gateway/mcp/virtual-mcp-server"},{"title":"OpenAPI to MCP Server","sidebarTitle":"OpenAPI to MCP Server","href":"/docs/ai-gateway/mcp/openapi-mcp-server"},{"title":"Hosted Stdio-based MCP Server","sidebarTitle":"Hosted Stdio-based MCP Server","href":"/docs/ai-gateway/mcp/stdio-mcp-server"},{"group":"MCP Server Guides","pages":[{"group":"Creating MCP Servers","pages":[{"title":"Create a Basic Calculator MCP Server","sidebarTitle":"Basic Calculator MCP Server","href":"/docs/ai-gateway/mcp/create-calculator-mcp-server"},{"title":"Add Okta OAuth to a Calculator MCP Server","sidebarTitle":"Okta OAuth MCP server","href":"/docs/ai-gateway/mcp/mcp-server-oauth-okta"},{"title":"Create an OAuth MCP Server with Azure Entra ID","sidebarTitle":"Azure Entra ID OAuth MCP Server","href":"/docs/ai-gateway/mcp/mcp-server-oauth-azure"}]}]}]},{"group":"Skills Registry","pages":[{"title":"AI Gateway Skills Registry","sidebarTitle":"Overview","href":"/docs/ai-gateway/skills/skills-registry"},{"title":"Create, Manage, and Use Skills","sidebarTitle":"Create, Manage and Use Skills","href":"/docs/ai-gateway/skills/getting-started"}]},{"group":"Prompt Registry","pages":[{"title":"Prompt Management","sidebarTitle":"Create, Manage and Use Prompts","href":"/docs/ai-gateway/prompt-management"}]},{"group":"Guardrails and Security","pages":[{"title":"AI Gateway Guardrails Overview","sidebarTitle":"Overview","description":"Learn about guardrails for ensuring safety, compliance, and quality in LLM interactions and MCP tool invocations.","href":"/docs/ai-gateway/guardrails-overview"},{"title":"AI Gateway Guardrails: Quick Start","sidebarTitle":"Getting Started","href":"/docs/ai-gateway/guardrails-getting-started"},{"title":"Configure Guardrail Policies","sidebarTitle":"Configure Guardrail Policies","description":"Create guardrail policies that decide which guardrails run on which requests — by model, MCP server, user, team, or request metadata.","href":"/docs/ai-gateway/guardrails-configuration"},{"group":"TrueFoundry Guardrails","root":{"title":"TrueFoundry Guardrails","sidebarTitle":"Overview","href":"/docs/ai-gateway/truefoundry-guardrails"},"pages":[{"title":"TrueFoundry Guardrails","sidebarTitle":"Overview","href":"/docs/ai-gateway/truefoundry-guardrails"},{"title":"Secrets Detection Guardrail","sidebarTitle":"Secrets Detection","href":"/docs/ai-gateway/secrets-detection"},{"title":"Code Safety Linter Guardrail","sidebarTitle":"Code Safety Linter","href":"/docs/ai-gateway/code-safety-linter"},{"title":"SQL Sanitizer Guardrail","sidebarTitle":"SQL Sanitizer","href":"/docs/ai-gateway/sql-sanitizer"},{"title":"Regex Pattern Match Guardrail","sidebarTitle":"Regex Pattern Match","href":"/docs/ai-gateway/regex-pattern-matching"},{"title":"Prompt Injection Guardrail","sidebarTitle":"Prompt Injection","href":"/docs/ai-gateway/tfy-prompt-injection"},{"title":"PII/PHI Detection Guardrail","sidebarTitle":"PII/PHI","href":"/docs/ai-gateway/tfy-pii"},{"title":"Content Moderation Guardrail","sidebarTitle":"Content Moderation","href":"/docs/ai-gateway/tfy-content-moderation"},{"title":"Metadata Validation Guardrail","sidebarTitle":"Metadata Validation","href":"/docs/ai-gateway/metadata-validation"},{"title":"Cedar Guardrails","sidebarTitle":"Cedar Guardrails","href":"/docs/ai-gateway/cedar-guardrails"},{"title":"OPA Guardrails","sidebarTitle":"OPA Guardrails","href":"/docs/ai-gateway/opa-guardrails"}]},{"group":"External Providers","pages":[{"title":"Akto Integration","sidebarTitle":"Akto","href":"/docs/ai-gateway/akto"},{"title":"Arthur AI","sidebarTitle":"Arthur AI","href":"/docs/ai-gateway/arthur-ai"},{"title":"AWS Bedrock Guardrail Integration","sidebarTitle":"AWS Bedrock Guardrail","href":"/docs/ai-gateway/bedrock-guardrails"},{"title":"Azure Content Safety Guardrail Integration","sidebarTitle":"Azure Content Safety","href":"/docs/ai-gateway/azure-content-safety"},{"title":"Azure PII Guardrail Integration","sidebarTitle":"Azure PII","href":"/docs/ai-gateway/azure-pii"},{"title":"Azure Prompt Shield Guardrail Integration","sidebarTitle":"Azure Prompt Shield","href":"/docs/ai-gateway/azure-prompt-shield"},{"title":"CrowdStrike AIDR Integration","sidebarTitle":"CrowdStrike AIDR","href":"/docs/ai-gateway/crowdstrike"},{"title":"Cato Networks","sidebarTitle":"Cato Networks","href":"/docs/ai-gateway/cato-networks"},{"title":"Cisco AI Defense Integration","sidebarTitle":"Cisco AI Defense","href":"/docs/ai-gateway/cisco-ai-defense"},{"title":"DeepKeep AI Firewall","sidebarTitle":"DeepKeep","href":"/docs/ai-gateway/deepkeep"},{"title":"Enkrypt AI Guardrail Integration","sidebarTitle":"Enkrypt AI","href":"/docs/ai-gateway/enkrypt-ai"},{"title":"F5 AI Security (CalypsoAI) Integration","sidebarTitle":"F5 AI Security","href":"/docs/ai-gateway/f5-calypsoai"},{"title":"Fiddler Integration","sidebarTitle":"Fiddler","href":"/docs/ai-gateway/fiddler"},{"title":"Fireworks Safety Model Guardrail for TrueFoundry AI Gateway","sidebarTitle":"Fireworks","href":"/docs/ai-gateway/fireworks"},{"title":"Google Model Armor Guardrail Integration","sidebarTitle":"Google Model Armor","href":"/docs/ai-gateway/google-model-armor"},{"title":"Gray Swan Cygnal","sidebarTitle":"Gray Swan Cygnal","href":"/docs/ai-gateway/grayswan-cygnal"},{"title":"Guardrails AI Integration","sidebarTitle":"Guardrails AI","href":"/docs/ai-gateway/guardrails-ai"},{"title":"HiddenLayer Integration","sidebarTitle":"HiddenLayer","href":"/docs/ai-gateway/hiddenlayer"},{"title":"CoreWeave Weave Guardrails Integration","sidebarTitle":"CoreWeave Guardrails","href":"/docs/ai-gateway/coreweave-weave-guardrails"},{"title":"Lasso Security","sidebarTitle":"Lasso Security","href":"/docs/ai-gateway/lasso-security"},{"title":"Noma Security","sidebarTitle":"Noma Security","href":"/docs/ai-gateway/noma-security"},{"title":"NVIDIA NeMo Guardrails Integration","sidebarTitle":"NVIDIA NeMo","href":"/docs/ai-gateway/nvidia-nemo"},{"title":"OpenAI Moderation Integration","sidebarTitle":"OpenAI Moderation","href":"/docs/ai-gateway/openai-moderations"},{"title":"Onyx Security","sidebarTitle":"Onyx Security","href":"/docs/ai-gateway/onyx-security"},{"title":"Palo Alto Prisma AIRS Integration","sidebarTitle":"Palo Alto Prisma AIRS","href":"/docs/ai-gateway/palo-alto-airs"},{"title":"Patronus AI Integration","sidebarTitle":"Patronus AI","href":"/docs/ai-gateway/patronus"},{"title":"Pillar Security Integration","sidebarTitle":"Pillar Security","href":"/docs/ai-gateway/pillar-security"},{"title":"Straiker","sidebarTitle":"Straiker","href":"/docs/ai-gateway/straiker"},{"title":"TrojAI DEFEND Integration","sidebarTitle":"TrojAI","href":"/docs/ai-gateway/trojai"},{"title":"Verra","sidebarTitle":"Verra","href":"/docs/ai-gateway/verra"},{"title":"Zscaler AI Guard guardrail for prompts and responses","sidebarTitle":"Zscaler AI Guard","href":"/docs/ai-gateway/zscaler-ai-guard"}]},{"title":"Custom Guardrail/Plugins Configuration","sidebarTitle":"Bring your own Guardrail / Plugin","href":"/docs/ai-gateway/custom-guardrails"}]},{"group":"Observability","pages":[{"title":"Metrics Dashboard","sidebarTitle":"Metrics Dashboard","href":"/docs/ai-gateway/analytics"},{"title":"Request Logging","sidebarTitle":"Request Logging","href":"/docs/ai-gateway/request-logging"},{"title":"Configure Data Access","sidebarTitle":"Configure Data Access","href":"/docs/ai-gateway/data-access"},{"title":"Configure Data Routing","sidebarTitle":"Configure Data Routing","href":"/docs/ai-gateway/data-routing"},{"group":"Export Logs and Metrics","pages":[{"title":"Export OpenTelemetry Data","sidebarTitle":"Export via OpenTelemetry","href":"/docs/ai-gateway/export-opentelemetry-data"},{"title":"Prometheus Grafana Integration","sidebarTitle":"Prometheus \u0026 Grafana","href":"/docs/ai-gateway/prometheus-grafana-integration"}]},{"group":"API Access to Metrics","expanded":false,"pages":[{"title":"Model Metrics","sidebarTitle":"Model Metrics","href":"/docs/ai-gateway/fetch-model-metrics"},{"title":"MCP Metrics","sidebarTitle":"MCP Metrics","href":"/docs/ai-gateway/fetch-mcp-metrics"},{"title":"Guardrail Metrics","sidebarTitle":"Guardrail Metrics","href":"/docs/ai-gateway/fetch-guardrail-metrics"},{"title":"Cache Metrics","sidebarTitle":"Cache Metrics","href":"/docs/ai-gateway/fetch-cache-metrics"},{"title":"Routing Metrics","sidebarTitle":"Routing Metrics","href":"/docs/ai-gateway/fetch-routing-metrics"},{"title":"Agent Metrics","sidebarTitle":"Agent Metrics","href":"/docs/ai-gateway/fetch-agent-metrics"}]},{"group":"API Access to Logs","root":{"title":"API Access to Logs","sidebarTitle":"Overview","href":"/docs/ai-gateway/fetch-request-logs"},"expanded":false,"directory":"accordion","pages":[{"title":"API Access to Logs","sidebarTitle":"Overview","href":"/docs/ai-gateway/fetch-request-logs"},{"title":"Request Logs: Trace Inspection","sidebarTitle":"Trace Inspection","href":"/docs/ai-gateway/fetch-request-logs-trace-inspection"},{"title":"Request Logs: Filtering","sidebarTitle":"Filtering","href":"/docs/ai-gateway/fetch-request-logs-filtering"},{"group":"Use Cases","expanded":false,"pages":[{"title":"Request Logs: Common Use Cases","sidebarTitle":"Basic Queries","href":"/docs/ai-gateway/fetch-request-logs-use-cases"},{"title":"Request Logs: Advanced Queries","sidebarTitle":"Advanced Queries","href":"/docs/ai-gateway/fetch-request-logs-use-cases-advanced"}]},{"group":"Span Attributes","expanded":false,"pages":[{"title":"Request Logs: Span Attributes","sidebarTitle":"TrueFoundry Attributes","href":"/docs/ai-gateway/fetch-request-logs-span-attributes"},{"title":"GenAI Span Attributes","sidebarTitle":"GenAI Attributes","href":"/docs/ai-gateway/fetch-request-logs-span-attributes-genai"}]}]}]},{"group":"Deployment","pages":[{"title":"Gateway Architecture","sidebarTitle":"Architecture","href":"/docs/ai-gateway/gateway-architecture"},{"title":"Deployment Options","sidebarTitle":"Deployment Options","href":"/docs/ai-gateway/modes-of-deployment"},{"title":"Globally Distributed SAAS Gateway","sidebarTitle":"Globally Distributed SAAS","href":"/docs/ai-gateway/globally-distributed-saas"},{"title":"Connect Private Models and MCP Servers","sidebarTitle":"Connect Private Endpoints","href":"/docs/ai-gateway/connect-private-models-mcp-servers"},{"title":"Install LLM Gateway (Standalone)","sidebarTitle":"Install AI Gateway","href":"/docs/ai-gateway/install-only-llm-gateway"}]},{"group":"Admin Guide","pages":[{"title":"Setup AI Gateway in Your Organization","sidebarTitle":"Setup AI Gateway in Org","href":"/docs/ai-gateway/setup-ai-gateway-in-org"},{"title":"Govern All AI Traffic Through the AI Gateway","sidebarTitle":"Govern All AI Traffic","href":"/docs/ai-gateway/govern-traffic-through-ai-gateway"},{"title":"Setup Dev, Staging and Prod Environments","sidebarTitle":"Setup Multiple Environments","href":"/docs/ai-gateway/setup-multiple-environments"},{"title":"Use Secret Manager in Integrations","sidebarTitle":"Use Secret Manager","href":"/docs/ai-gateway/secret-manager-in-ai-gateway"}]},{"group":"Chat","pages":[{"title":"Chat Completions","deprecated":null,"version":null,"openapi":"/gateway-openapi.json post /chat/completions","href":"/docs/api-reference/chat/chat-completions"}]},{"group":"Messages","pages":[{"title":"Messages","deprecated":null,"version":null,"openapi":"/gateway-openapi.json post /messages","href":"/docs/api-reference/messages/messages"},{"title":"Count Tokens","deprecated":null,"version":null,"openapi":"/gateway-openapi.json post /messages/count_tokens","href":"/docs/api-reference/messages/count-tokens"}]},{"group":"Embeddings","pages":[{"title":"Generate Embeddings","deprecated":null,"version":null,"openapi":"/gateway-openapi.json post /embeddings","href":"/docs/api-reference/embeddings/generate-embeddings"}]},{"group":"Rerank","pages":[{"title":"Rerank Documents","deprecated":null,"version":null,"openapi":"/gateway-openapi.json post /v2/rerank","href":"/docs/api-reference/rerank/rerank-documents"}]},{"group":"Responses","pages":[{"title":"List Model Response Input Items","deprecated":null,"version":null,"openapi":"/gateway-openapi.json get /responses/{id}/input_items","href":"/docs/api-reference/responses/list-model-response-input-items"},{"title":"Get Model Response","deprecated":null,"version":null,"openapi":"/gateway-openapi.json get /responses/{id}","href":"/docs/api-reference/responses/get-model-response"},{"title":"Delete Model Response","deprecated":null,"version":null,"openapi":"/gateway-openapi.json delete /responses/{id}","href":"/docs/api-reference/responses/delete-model-response"},{"title":"Model Responses","deprecated":null,"version":null,"openapi":"/gateway-openapi.json post /responses","href":"/docs/api-reference/responses/model-responses"},{"title":"Model Responses Compact","deprecated":null,"version":null,"openapi":"/gateway-openapi.json post /responses/compact","href":"/docs/api-reference/responses/model-responses-compact"}]},{"group":"Image","pages":[{"title":"Generate Images","deprecated":null,"version":null,"openapi":"/gateway-openapi.json post /images/generations","href":"/docs/api-reference/image/generate-images"},{"title":"Edit Images","deprecated":null,"version":null,"openapi":"/gateway-openapi.json post /images/edits","href":"/docs/api-reference/image/edit-images"},{"title":"Create Image Variation","deprecated":null,"version":null,"openapi":"/gateway-openapi.json post /images/variations","href":"/docs/api-reference/image/create-image-variation"}]},{"group":"Audio","pages":[{"title":"Transcribe Audio","deprecated":null,"version":null,"openapi":"/gateway-openapi.json post /audio/transcriptions","href":"/docs/api-reference/audio/transcribe-audio"},{"title":"Translate Audio","deprecated":null,"version":null,"openapi":"/gateway-openapi.json post /audio/translations","href":"/docs/api-reference/audio/translate-audio"},{"title":"Generate Speech","deprecated":null,"version":null,"openapi":"/gateway-openapi.json post /audio/speech","href":"/docs/api-reference/audio/generate-speech"}]},{"group":"Batch","pages":[{"title":"List Batches","deprecated":null,"version":null,"openapi":"/gateway-openapi.json get /batches","href":"/docs/api-reference/batch/list-batches"},{"title":"Create Batch","deprecated":null,"version":null,"openapi":"/gateway-openapi.json post /batches","href":"/docs/api-reference/batch/create-batch"},{"title":"Get Batch","deprecated":null,"version":null,"openapi":"/gateway-openapi.json get /batches/{id}","href":"/docs/api-reference/batch/get-batch"},{"title":"Get Batch Output","deprecated":null,"version":null,"openapi":"/gateway-openapi.json get /batches/{id}/output","href":"/docs/api-reference/batch/get-batch-output"},{"title":"Cancel Batch","deprecated":null,"version":null,"openapi":"/gateway-openapi.json post /batches/{id}/cancel","href":"/docs/api-reference/batch/cancel-batch"}]},{"group":"Files","pages":[{"title":"List Files","deprecated":null,"version":null,"openapi":"/gateway-openapi.json get /files","href":"/docs/api-reference/files/list-files"},{"title":"Upload File","deprecated":null,"version":null,"openapi":"/gateway-openapi.json post /files","href":"/docs/api-reference/files/upload-file"},{"title":"Get File","deprecated":null,"version":null,"openapi":"/gateway-openapi.json get /files/{id}","href":"/docs/api-reference/files/get-file"},{"title":"Delete File","deprecated":null,"version":null,"openapi":"/gateway-openapi.json delete /files/{id}","href":"/docs/api-reference/files/delete-file"},{"title":"Get File Content","deprecated":null,"version":null,"openapi":"/gateway-openapi.json get /files/{id}/content","href":"/docs/api-reference/files/get-file-content"}]},{"group":"Fine-tuning","pages":[{"title":"List Fine-tuning Jobs","deprecated":null,"version":null,"openapi":"/gateway-openapi.json get /fine_tuning/jobs","href":"/docs/api-reference/fine-tuning/list-fine-tuning-jobs"},{"title":"Create Fine-tuning Job","deprecated":null,"version":null,"openapi":"/gateway-openapi.json post /fine_tuning/jobs","href":"/docs/api-reference/fine-tuning/create-fine-tuning-job"},{"title":"Retrieve Fine-tuning Job","deprecated":null,"version":null,"openapi":"/gateway-openapi.json get /fine_tuning/jobs/{fine_tuning_job_id}","href":"/docs/api-reference/fine-tuning/retrieve-fine-tuning-job"},{"title":"Cancel Fine-tuning Job","deprecated":null,"version":null,"openapi":"/gateway-openapi.json post /fine_tuning/jobs/{fine_tuning_job_id}/cancel","href":"/docs/api-reference/fine-tuning/cancel-fine-tuning-job"}]},{"group":"Moderations","pages":[{"title":"Create Moderation","deprecated":null,"version":null,"openapi":"/gateway-openapi.json post /moderations","href":"/docs/api-reference/moderations/create-moderation"}]},{"group":"Video","pages":[{"title":"Poll or Download Video","deprecated":null,"version":null,"openapi":"/gateway-openapi.json get /videos-proxy/{providerAccountName}/{nativePath}","href":"/docs/api-reference/video/poll-or-download-video"},{"title":"Generate Video","deprecated":null,"version":null,"openapi":"/gateway-openapi.json post /videos-proxy/{providerAccountName}/{nativePath}","href":"/docs/api-reference/video/generate-video"}]},{"group":"Models","pages":[{"title":"List available models","deprecated":null,"version":null,"openapi":"/gateway-openapi.json get /models","href":"/docs/api-reference/models/list-available-models"}]}]},{"tab":"Agent Platform","pages":[{"title":"Agent Platform","href":"/docs/agent-platform/agent-harness/overview"}]},{"tab":"Platform","pages":[{"title":"Platform","href":"/docs/platform/overview"}]},{"tab":"AI Deployment","pages":[{"title":"AI Deployment","href":"/docs/ai-deployment-overview"}]},{"tab":"API Reference","pages":[{"title":"API Reference","href":"/docs/truefoundry_sdk"}]},{"tab":"Integrations","pages":[{"title":"Integrations","href":"/docs/ai-gateway/ecosystem"}]},{"tab":"Changelog","pages":[{"title":"Changelog","href":"/docs/changelog"}]}]},"basePath":"","title":"AI Gateway Guardrails: Quick Start - TrueFoundry Docs","buildId":"dpl_596ePT575z4qnAFksq1biRW97aLY","deploymentId":"dpl_596ePT575z4qnAFksq1biRW97aLY","dynamics":["07c022d89b","a74be98ba7"],"chunks":["Frame-BXrZabKK.js","DynamicMarkdown-CtasenyM.js","zoom-image-lightbox-C5F0mVLH.js","lightbox-handle-r17bVUz3.js"]}