Guardrail Schema
Overview
Guardrail schema allows you to enforce structural validation on request messages and response messages exchanged with agentic components and MCP tools.
Guardrail schema validation checks whether request payloads and response payloads follow the expected JSON structure. Akto starts with evaluating configured JSON paths in request messages and response messages for the selected component.
Akto blocks the transaction when required fields are missing or when payload structure deviates from configured schema rules. The validation helps you maintain consistent data contracts between agents, MCP tools, and enterprise services.
Steps to Configure
Follow the steps below to configure guardrail schema validation for a component.
Navigate to Guardrail Schema Configuration
Navigate to Agentic AI Discovery.
Open the required Agentic Collection.
Locate the required component.
Click the three-dot horizontal menu at the end of the component row.
Select Configure Guardrail schema.

The guardrail schema configuration dialog opens for the selected component.

Configure Request Message Fields
Locate the Request message fields section.
Click Add field.
Enter the required JSON path representing a request field that must exist in the request payload.
Add additional fields when multiple request attributes require validation.
Akto validates incoming request payloads against the configured JSON paths.
Configure Response Message Fields
Locate the Response message fields section.
Click Add field.
Enter the required JSON path representing a response field that must exist in the response payload.
Add additional fields when multiple response attributes require validation.
Akto validates tool response payloads against the configured response field definitions.
Configure Guardrail Blocking Behaviour
Define the response returned when schema validation fails.
Blocked response code
HTTP status code returned when Akto blocks a transaction. Example: 403.
Blocked response body
Response payload returned when Akto blocks the request or response. Example: { "error": "Request blocked by guardrail" }.
Blocked response content type
Content type returned for the blocked response. Example: application/json.
Click Save to apply the schema validation configuration.
Result
Akto then starts evaluating request messages and response messages for the selected component after you save the configuration.
Akto will block transactions when request payloads or response payloads violate configured schema validation rules. And Akto returns the configured blocked response when guardrail enforcement occurs.
Last updated