Schema-aware API protection. Bunny Shield enforces your OpenAPI contract at the edge so requests and responses match what your application expects.
API Guardian uses your OpenAPI specification as the source of truth for what your API accepts. At the edge, every request is validated against the schema, authenticated against the configured security scheme, and counted against per-endpoint rate limits before reaching your origin.
API Guardian starts with your OpenAPI schema and transforms it into a real-time enforcement layer at the edge.When a specification is uploaded:
The schema is normalized and processed
Internal references are resolved
Validation rules are compiled into native Bunny Shield protections
Every incoming request is checked against this contract before reaching your origin. Only requests matching your defined API structure are allowed through.Validation includes:
Path parameters to ensure correct structure and types
Query parameters to validate allowed fields and formats
Headers and cookies to enforce required values
JSON request bodies (application/json and *+json) to match schema definitions
Execution mode controls how API Guardian enforces its decisions globally:
Log to observe validation results without blocking traffic
Block to enforce validation decisions at the edge
This setting applies to all validation outcomes and overrides any individual blocking decision, allowing you to safely test API Guardian in log mode before enforcing it.
Not all requests will match a defined path in your schema. The Unmatched Path Action controls how these requests are treated:
Block to reject requests targeting undefined endpoints (subject to execution mode)
Log to record unmatched requests while still forwarding them
Ignore to bypass API Guardian entirely for unmatched paths
Only Ignore lets an unmatched request reach the Managed WAF ruleset; under Block and Log, Managed WAF is skipped. Other Shield features such as Rate Limiting and Bot Detection apply regardless of this setting.Requests that do match a declared path are always handled by API Guardian’s schema validation and path enforcement, instead of the Managed WAF ruleset, to avoid false positives common with structured API traffic.
Unmatched path handling is not limited to literal path definitions.API Guardian automatically allows endpoints referenced by your authentication schemes, so login and token-exchange flows work without manual schema duplication.For OpenID Connect:
The provider’s discovery metadata is fetched
Advertised endpoints (authorization, token, userinfo, JWKS, etc.) are automatically allowed
Keys are kept up to date as they rotate
This allows login and token exchange flows to function correctly while still enforcing schema validation across your API.
APIs don’t just define what they accept, but also what they return.API Guardian can validate responses against your schema on a per-endpoint basis. This helps prevent:
Unexpected fields being exposed
Incorrect response formats
Edge-case behavior leaking unintended data
Responses are validated before leaving your infrastructure, ensuring consistency between your API contract and real-world behavior.
API Guardian enforces authentication requirements defined in your OpenAPI schema before requests reach your origin.Supported authentication methods include:
API Keys (headers, query parameters, cookies)
HTTP Authentication (Bearer and Basic)
OAuth2
OpenID Connect
Requests missing required credentials are rejected immediately, filtering out a large portion of automated and low-effort attack traffic.
JWT structure and expiration are validated for bearerFormat: jwt
Signature verification is performed for OpenID Connect providers using public-key algorithms
JWKS endpoints are automatically fetched and refreshed
Tokens must match the expected issuer and signing algorithm
Supported algorithms include RSA and ECDSA (256, 384, 512-bit). Invalid, expired, unsigned, or tampered tokens are rejected at the edge before reaching your application.
Schema validation ensures requests are structurally correct, but some attacks rely on valid structure with malicious content.API Guardian allows you to combine schema enforcement with targeted deep inspection:
Select specific query, path, header, or cookie parameters for inspection
Detect patterns like SQL injection and cross-site scripting (XSS)
Apply deep inspection only where needed, reducing unnecessary overhead
You can also define inspection rules directly in your OpenAPI schema using the x-bunny-shield extension.This allows you to attach detection logic to specific fields:
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"bunny.net Documentation","colors":{"primary":"#EF6126","light":"#EF6126","dark":"#EF6126"},"logo":{"light":"https://mintcdn.com/bunnynet-cb9733c2/54-4KCQKoNVNuoyW/logo/bunny-logo-dark.svg?fit=max\u0026auto=format\u0026n=54-4KCQKoNVNuoyW\u0026q=85\u0026s=62c091ea1aaea93d0a981902b7783e37","dark":"https://mintcdn.com/bunnynet-cb9733c2/54-4KCQKoNVNuoyW/logo/bunny-logo-light.svg?fit=max\u0026auto=format\u0026n=54-4KCQKoNVNuoyW\u0026q=85\u0026s=3610e32d68a9fa458b0116ac58ca812a"},"favicon":"https://mintcdn.com/bunnynet-cb9733c2/1bTPx1eyQm8EK8W3/favicon.png?fit=max\u0026auto=format\u0026n=1bTPx1eyQm8EK8W3\u0026q=85\u0026s=85267b63e804fac7a4dd94599bb8c6e8","navbar":{"links":[{"href":"https://bunny.net/docs/api-reference","label":"API Reference"},{"href":"https://github.com/BunnyWay","label":"GitHub"}],"primary":{"type":"button","label":"Get Started","href":"https://dash.bunny.net/auth/register"}},"footer":{"socials":{"discord":"https://discord.gg/bunnynet","github":"https://github.com/BunnyWay","x":"https://x.com/BunnyCDN","bluesky":"https://bsky.app/profile/bunny.net","linkedin":"https://www.linkedin.com/company/bunnynet","facebook":"https://www.facebook.com/bunnycdn"}},"icons":{"library":"lucide"},"contextual":{"options":["copy","claude","chatgpt","cursor","view","vscode"],"display":"header"},"interaction":{"drilldown":false},"metadata":{"timestamp":true},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"bunnynet-cb9733c2","hasAudioNarration":false,"actualSubdomain":"bunnynet-cb9733c2","customDomains":["bunny.net"],"gitSource":{"type":"github","owner":"bunnyway","repo":"documentation","deployBranch":"main","contentDirectory":"","isPrivate":false,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6ae49f2d21d44d6b52dcfe35","collectionId":"5e262b87-ade9-45d8-9b63-06888c8d59a3","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6ae49f2d21d44d6b52dcfe35"},"feedback":{"thumbs":true,"contextualFeedback":{"allowEmail":true},"agentFeedback":true,"edits":true,"issues":false},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6ae534f2b9a26f131eb41834","clientVersion":"0.0.4043","searchFilterCounts":[{"language":"default","tag":"Documentation","count":752},{"language":"default","tag":"API Reference","count":318},{"language":"default","tag":"Core Platform API","count":109},{"language":"default","tag":"CDN","count":82},{"language":"default","tag":"Shield API","count":66},{"language":"default","tag":"Stream","count":66},{"language":"default","tag":"Magic Containers API","count":56},{"language":"default","tag":"Storage","count":54},{"language":"default","tag":"Guides","count":54},{"language":"default","tag":"Reference","count":52}],"searchSettings":{"isFiltersEnabled":true}},"assistantConfig":{"enableStarterQuestions":false,"deflection":{"enabled":true,"type":"link","email":"support@bunny.net","url":"https://bunny.net/contact","showHelpButton":true}},"basePath":"/docs","hasChatPermissions":true,"hasWebMcpPermissions":true,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"byok-sep-25","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-updated-9-15","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"privacy":{"consentBanner":{"enabled":true}},"googleFontsInlined":false},"customCss":[{"filePath":"style.css","content":".dark img[src*=\"/logo/frameworks/angular.svg\"],.dark img[src*=\"/logo/frameworks/eleventy.svg\"],.dark img[src*=\"/logo/frameworks/express.svg\"],.dark img[src*=\"/logo/frameworks/mariadb.svg\"],.dark img[src*=\"/logo/frameworks/nextjs.svg\"],.dark img[src*=\"/logo/frameworks/sphinx.svg\"]{filter:invert(1)}html:not(.dark) img[src*=\"/logo/frameworks/zola.svg\"]{filter:invert(1)}"}],"page":{"pagePath":"shield/api-guardian","slug":"/shield/api-guardian","pageMetadata":{"title":"API Guardian","description":"Schema-aware API protection. Bunny Shield enforces your OpenAPI contract at the edge so requests and responses match what your application expects.","href":"/shield/api-guardian"},"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: \"Schema-aware API protection. Bunny Shield enforces your OpenAPI contract at the edge so requests and responses match what your application expects.\"\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={code:`code`,li:`li`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Heading,OptimizedImage}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!OptimizedImage)_missingMdxReference(`OptimizedImage`,true);return _jsxs(_Fragment,{children:[_jsx(_components.p,{children:`API Guardian uses your OpenAPI specification as the source of truth for what your API accepts. At the edge, every request is validated against the schema, authenticated against the configured security scheme, and counted against per-endpoint rate limits before reaching your origin.`}),`\n`,_jsx(Heading,{level:`2`,id:`key-features`,children:`Key Features`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Schema-Based Validation`}),`: Upload your OpenAPI specification and turn it into enforceable validation rules that run directly at the edge.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Full Request Coverage`}),`: Validate path parameters, query strings, headers, cookies, and JSON request bodies against your API contract.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Edge Authentication Enforcement`}),`: Enforce API keys, Bearer tokens, OAuth2, and OpenID Connect validation before requests reach your origin.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Response Validation`}),`: Ensure responses match your schema to prevent accidental data exposure or inconsistent output.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Per-Endpoint Rate Limiting`}),`: Apply granular rate limits aligned with your API structure, including support for dynamic path templates.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Integrated Protection`}),`: Combine schema validation with targeted WAF-style inspection for injection attacks on selected parameters.`]}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`schema-driven-request-validation`,children:`Schema-driven request validation`}),`\n`,_jsx(_components.p,{children:`API Guardian starts with your OpenAPI schema and transforms it into a real-time enforcement layer at the edge.`}),`\n`,_jsx(_components.p,{children:`When a specification is uploaded:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`The schema is normalized and processed`}),`\n`,_jsx(_components.li,{children:`Internal references are resolved`}),`\n`,_jsx(_components.li,{children:`Validation rules are compiled into native Bunny Shield protections`}),`\n`]}),`\n`,_jsx(_components.p,{children:`Every incoming request is checked against this contract before reaching your origin. Only requests matching your defined API structure are allowed through.`}),`\n`,_jsx(_components.p,{children:`Validation includes:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Path parameters`}),` to ensure correct structure and types`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Query parameters`}),` to validate allowed fields and formats`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Headers and cookies`}),` to enforce required values`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`JSON request bodies`}),` (`,_jsx(_components.code,{children:`application/json`}),` and `,_jsx(_components.code,{children:`*+json`}),`) to match schema definitions`]}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`handling-non-conforming-requests`,children:`Handling non-conforming requests`}),`\n`,_jsx(_components.p,{children:`API Guardian provides two layers of control over how requests that don’t match your schema are handled.`}),`\n`,_jsx(Heading,{level:`3`,id:`rule-execution-mode`,children:`Rule execution mode`}),`\n`,_jsx(_components.p,{children:`Execution mode controls how API Guardian enforces its decisions globally:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Log`}),` to observe validation results without blocking traffic`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Block`}),` to enforce validation decisions at the edge`]}),`\n`]}),`\n`,_jsx(_components.p,{children:`This setting applies to all validation outcomes and overrides any individual blocking decision, allowing you to safely test API Guardian in log mode before enforcing it.`}),`\n`,_jsx(Heading,{level:`3`,id:`unmatched-path-handling`,children:`Unmatched path handling`}),`\n`,_jsxs(_components.p,{children:[`Not all requests will match a defined path in your schema. The `,_jsx(_components.strong,{children:`Unmatched Path Action`}),` controls how these requests are treated:`]}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Block`}),` to reject requests targeting undefined endpoints (subject to execution mode)`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Log`}),` to record unmatched requests while still forwarding them`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Ignore`}),` to bypass API Guardian entirely for unmatched paths`]}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`Only `,_jsx(_components.strong,{children:`Ignore`}),` lets an unmatched request reach the Managed WAF ruleset; under `,_jsx(_components.strong,{children:`Block`}),` and `,_jsx(_components.strong,{children:`Log`}),`, Managed WAF is skipped. Other Shield features such as Rate Limiting and Bot Detection apply regardless of this setting.`]}),`\n`,_jsxs(_components.p,{children:[`Requests that `,_jsx(_components.strong,{children:`do match`}),` a declared path are always handled by API Guardian’s schema validation and path enforcement, instead of the Managed WAF ruleset, to avoid false positives common with structured API traffic.`]}),`\n`,_jsx(Heading,{level:`3`,id:`authentication-aware-path-handling`,children:`Authentication-aware path handling`}),`\n`,_jsx(_components.p,{children:`Unmatched path handling is not limited to literal path definitions.`}),`\n`,_jsx(_components.p,{children:`API Guardian automatically allows endpoints referenced by your authentication schemes, so login and token-exchange flows work without manual schema duplication.`}),`\n`,_jsx(_components.p,{children:`For OpenID Connect:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`The provider’s discovery metadata is fetched`}),`\n`,_jsx(_components.li,{children:`Advertised endpoints (authorization, token, userinfo, JWKS, etc.) are automatically allowed`}),`\n`,_jsx(_components.li,{children:`Keys are kept up to date as they rotate`}),`\n`]}),`\n`,_jsx(_components.p,{children:`This allows login and token exchange flows to function correctly while still enforcing schema validation across your API.`}),`\n`,_jsx(OptimizedImage,{src:`https://mintcdn.com/bunnynet-cb9733c2/54-4KCQKoNVNuoyW/images/shield/api-guardian/request-validation.png?fit=max\u0026auto=format\u0026n=54-4KCQKoNVNuoyW\u0026q=85\u0026s=2088fa7fc94bb3fdeca89ab8485874aa`,alt:``,\"data-og-width\":`1563`,width:`1563`,\"data-og-height\":`948`,height:`948`,\"data-path\":`images/shield/api-guardian/request-validation.png`,\"data-optimize\":`true`,\"data-opv\":`3`,srcset:`https://mintcdn.com/bunnynet-cb9733c2/54-4KCQKoNVNuoyW/images/shield/api-guardian/request-validation.png?w=280\u0026fit=max\u0026auto=format\u0026n=54-4KCQKoNVNuoyW\u0026q=85\u0026s=43a68ff17e2e108c8484c16023e90a9a 280w, https://mintcdn.com/bunnynet-cb9733c2/54-4KCQKoNVNuoyW/images/shield/api-guardian/request-validation.png?w=560\u0026fit=max\u0026auto=format\u0026n=54-4KCQKoNVNuoyW\u0026q=85\u0026s=b8a5040495ef31571bf13d4f543613a4 560w, https://mintcdn.com/bunnynet-cb9733c2/54-4KCQKoNVNuoyW/images/shield/api-guardian/request-validation.png?w=840\u0026fit=max\u0026auto=format\u0026n=54-4KCQKoNVNuoyW\u0026q=85\u0026s=66c3003f25da68ab2b3a96d40e6c7768 840w, https://mintcdn.com/bunnynet-cb9733c2/54-4KCQKoNVNuoyW/images/shield/api-guardian/request-validation.png?w=1100\u0026fit=max\u0026auto=format\u0026n=54-4KCQKoNVNuoyW\u0026q=85\u0026s=3c1ab0da5a04e901d0511c15bdaed70f 1100w, https://mintcdn.com/bunnynet-cb9733c2/54-4KCQKoNVNuoyW/images/shield/api-guardian/request-validation.png?w=1650\u0026fit=max\u0026auto=format\u0026n=54-4KCQKoNVNuoyW\u0026q=85\u0026s=018d46e2e7cdb35bb8d7a3c58e566b65 1650w, https://mintcdn.com/bunnynet-cb9733c2/54-4KCQKoNVNuoyW/images/shield/api-guardian/request-validation.png?w=2500\u0026fit=max\u0026auto=format\u0026n=54-4KCQKoNVNuoyW\u0026q=85\u0026s=da212155a260733fe5cc50c629fb9843 2500w`}),`\n`,_jsx(Heading,{level:`2`,id:`response-validation`,children:`Response validation`}),`\n`,_jsx(_components.p,{children:`APIs don’t just define what they accept, but also what they return.`}),`\n`,_jsx(_components.p,{children:`API Guardian can validate responses against your schema on a per-endpoint basis. This helps prevent:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`Unexpected fields being exposed`}),`\n`,_jsx(_components.li,{children:`Incorrect response formats`}),`\n`,_jsx(_components.li,{children:`Edge-case behavior leaking unintended data`}),`\n`]}),`\n`,_jsx(_components.p,{children:`Responses are validated before leaving your infrastructure, ensuring consistency between your API contract and real-world behavior.`}),`\n`,_jsx(OptimizedImage,{src:`https://mintcdn.com/bunnynet-cb9733c2/54-4KCQKoNVNuoyW/images/shield/api-guardian/response-validation.png?fit=max\u0026auto=format\u0026n=54-4KCQKoNVNuoyW\u0026q=85\u0026s=52ce6336567e909d1a2d01d10793a733`,alt:``,\"data-og-width\":`1390`,width:`1390`,\"data-og-height\":`796`,height:`796`,\"data-path\":`images/shield/api-guardian/response-validation.png`,\"data-optimize\":`true`,\"data-opv\":`3`,srcset:`https://mintcdn.com/bunnynet-cb9733c2/54-4KCQKoNVNuoyW/images/shield/api-guardian/response-validation.png?w=280\u0026fit=max\u0026auto=format\u0026n=54-4KCQKoNVNuoyW\u0026q=85\u0026s=247a59bf8954b9669c558a2d02dd9a06 280w, https://mintcdn.com/bunnynet-cb9733c2/54-4KCQKoNVNuoyW/images/shield/api-guardian/response-validation.png?w=560\u0026fit=max\u0026auto=format\u0026n=54-4KCQKoNVNuoyW\u0026q=85\u0026s=4e8884ece78c7d40bc036640d6f1cdb4 560w, https://mintcdn.com/bunnynet-cb9733c2/54-4KCQKoNVNuoyW/images/shield/api-guardian/response-validation.png?w=840\u0026fit=max\u0026auto=format\u0026n=54-4KCQKoNVNuoyW\u0026q=85\u0026s=7ef2954144485475a6624825a6074bf7 840w, https://mintcdn.com/bunnynet-cb9733c2/54-4KCQKoNVNuoyW/images/shield/api-guardian/response-validation.png?w=1100\u0026fit=max\u0026auto=format\u0026n=54-4KCQKoNVNuoyW\u0026q=85\u0026s=89d9822af8050ce16dcec690d1e1d722 1100w, https://mintcdn.com/bunnynet-cb9733c2/54-4KCQKoNVNuoyW/images/shield/api-guardian/response-validation.png?w=1650\u0026fit=max\u0026auto=format\u0026n=54-4KCQKoNVNuoyW\u0026q=85\u0026s=bcba07ba73a98d77005038ebd4c3e4cb 1650w, https://mintcdn.com/bunnynet-cb9733c2/54-4KCQKoNVNuoyW/images/shield/api-guardian/response-validation.png?w=2500\u0026fit=max\u0026auto=format\u0026n=54-4KCQKoNVNuoyW\u0026q=85\u0026s=0d0e2a45e82b5b1fbf68dee5a40e43e4 2500w`}),`\n`,_jsx(Heading,{level:`2`,id:`authentication-enforcement-at-the-edge`,children:`Authentication enforcement at the edge`}),`\n`,_jsx(_components.p,{children:`API Guardian enforces authentication requirements defined in your OpenAPI schema before requests reach your origin.`}),`\n`,_jsx(_components.p,{children:`Supported authentication methods include:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`API Keys`}),` (headers, query parameters, cookies)`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`HTTP Authentication`}),` (Bearer and Basic)`]}),`\n`,_jsx(_components.li,{children:_jsx(_components.strong,{children:`OAuth2`})}),`\n`,_jsx(_components.li,{children:_jsx(_components.strong,{children:`OpenID Connect`})}),`\n`]}),`\n`,_jsx(_components.p,{children:`Requests missing required credentials are rejected immediately, filtering out a large portion of automated and low-effort attack traffic.`}),`\n`,_jsx(Heading,{level:`3`,id:`token-validation`,children:`Token validation`}),`\n`,_jsx(_components.p,{children:`For Bearer tokens and OpenID Connect:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`JWT structure and expiration`}),` are validated for `,_jsx(_components.code,{children:`bearerFormat: jwt`})]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Signature verification`}),` is performed for OpenID Connect providers using public-key algorithms`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`JWKS endpoints`}),` are automatically fetched and refreshed`]}),`\n`,_jsxs(_components.li,{children:[`Tokens must match the expected `,_jsx(_components.strong,{children:`issuer`}),` and `,_jsx(_components.strong,{children:`signing algorithm`})]}),`\n`]}),`\n`,_jsx(_components.p,{children:`Supported algorithms include RSA and ECDSA (256, 384, 512-bit). Invalid, expired, unsigned, or tampered tokens are rejected at the edge before reaching your application.`}),`\n`,_jsx(OptimizedImage,{src:`https://mintcdn.com/bunnynet-cb9733c2/54-4KCQKoNVNuoyW/images/shield/api-guardian/authentication.png?fit=max\u0026auto=format\u0026n=54-4KCQKoNVNuoyW\u0026q=85\u0026s=09921c4ec033f3ec7e79f4c4741023ea`,alt:``,\"data-og-width\":`1393`,width:`1393`,\"data-og-height\":`234`,height:`234`,\"data-path\":`images/shield/api-guardian/authentication.png`,\"data-optimize\":`true`,\"data-opv\":`3`,srcset:`https://mintcdn.com/bunnynet-cb9733c2/54-4KCQKoNVNuoyW/images/shield/api-guardian/authentication.png?w=280\u0026fit=max\u0026auto=format\u0026n=54-4KCQKoNVNuoyW\u0026q=85\u0026s=3aa38f472cab954514eb86e3e80a2112 280w, https://mintcdn.com/bunnynet-cb9733c2/54-4KCQKoNVNuoyW/images/shield/api-guardian/authentication.png?w=560\u0026fit=max\u0026auto=format\u0026n=54-4KCQKoNVNuoyW\u0026q=85\u0026s=bf3291670ed94d20d8c587903a846a5c 560w, https://mintcdn.com/bunnynet-cb9733c2/54-4KCQKoNVNuoyW/images/shield/api-guardian/authentication.png?w=840\u0026fit=max\u0026auto=format\u0026n=54-4KCQKoNVNuoyW\u0026q=85\u0026s=b7e6cd113cd67fc15a9c33782bc4e8ca 840w, https://mintcdn.com/bunnynet-cb9733c2/54-4KCQKoNVNuoyW/images/shield/api-guardian/authentication.png?w=1100\u0026fit=max\u0026auto=format\u0026n=54-4KCQKoNVNuoyW\u0026q=85\u0026s=f117804d9f4831303713e8608d8821e0 1100w, https://mintcdn.com/bunnynet-cb9733c2/54-4KCQKoNVNuoyW/images/shield/api-guardian/authentication.png?w=1650\u0026fit=max\u0026auto=format\u0026n=54-4KCQKoNVNuoyW\u0026q=85\u0026s=e9f6a5b3993c70e21cddbc092717f7b4 1650w, https://mintcdn.com/bunnynet-cb9733c2/54-4KCQKoNVNuoyW/images/shield/api-guardian/authentication.png?w=2500\u0026fit=max\u0026auto=format\u0026n=54-4KCQKoNVNuoyW\u0026q=85\u0026s=d5aca9179b2c3d9593efe34e4fc93855 2500w`}),`\n`,_jsx(Heading,{level:`2`,id:`per-endpoint-rate-limiting`,children:`Per-endpoint rate limiting`}),`\n`,_jsx(_components.p,{children:`Not all endpoints behave the same, and API Guardian reflects that.`}),`\n`,_jsx(_components.p,{children:`You can define rate limits directly per endpoint:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`Supports dynamic paths like `,_jsx(_components.code,{children:`/users/{id}`})]}),`\n`,_jsx(_components.li,{children:`Applies limits at the template level across all variations`}),`\n`,_jsx(_components.li,{children:`Configurable per endpoint or per IP address`}),`\n`,_jsxs(_components.li,{children:[`Time windows from `,_jsx(_components.strong,{children:`1 second to 1 hour`})]}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`Versioned endpoints (e.g., `,_jsx(_components.code,{children:`/v1`}),`, `,_jsx(_components.code,{children:`/v2`}),`) are treated independently, allowing precise control as your API evolves.`]}),`\n`,_jsx(OptimizedImage,{src:`https://mintcdn.com/bunnynet-cb9733c2/54-4KCQKoNVNuoyW/images/shield/api-guardian/rate-limiting.png?fit=max\u0026auto=format\u0026n=54-4KCQKoNVNuoyW\u0026q=85\u0026s=0c192d3a6bd10de36c9d70e5aa0363f0`,alt:``,\"data-og-width\":`1390`,width:`1390`,\"data-og-height\":`223`,height:`223`,\"data-path\":`images/shield/api-guardian/rate-limiting.png`,\"data-optimize\":`true`,\"data-opv\":`3`,srcset:`https://mintcdn.com/bunnynet-cb9733c2/54-4KCQKoNVNuoyW/images/shield/api-guardian/rate-limiting.png?w=280\u0026fit=max\u0026auto=format\u0026n=54-4KCQKoNVNuoyW\u0026q=85\u0026s=a4231cf335d5466b560c5e93f8fa67ba 280w, https://mintcdn.com/bunnynet-cb9733c2/54-4KCQKoNVNuoyW/images/shield/api-guardian/rate-limiting.png?w=560\u0026fit=max\u0026auto=format\u0026n=54-4KCQKoNVNuoyW\u0026q=85\u0026s=86f70bc7310223f05c005234bf36de3e 560w, https://mintcdn.com/bunnynet-cb9733c2/54-4KCQKoNVNuoyW/images/shield/api-guardian/rate-limiting.png?w=840\u0026fit=max\u0026auto=format\u0026n=54-4KCQKoNVNuoyW\u0026q=85\u0026s=dcde6c9b543b2dc23c21161c19c61275 840w, https://mintcdn.com/bunnynet-cb9733c2/54-4KCQKoNVNuoyW/images/shield/api-guardian/rate-limiting.png?w=1100\u0026fit=max\u0026auto=format\u0026n=54-4KCQKoNVNuoyW\u0026q=85\u0026s=0210b9143d4dce8ab276e0f95ac89256 1100w, https://mintcdn.com/bunnynet-cb9733c2/54-4KCQKoNVNuoyW/images/shield/api-guardian/rate-limiting.png?w=1650\u0026fit=max\u0026auto=format\u0026n=54-4KCQKoNVNuoyW\u0026q=85\u0026s=6a2b656348518a5ddae0e5da0edd1009 1650w, https://mintcdn.com/bunnynet-cb9733c2/54-4KCQKoNVNuoyW/images/shield/api-guardian/rate-limiting.png?w=2500\u0026fit=max\u0026auto=format\u0026n=54-4KCQKoNVNuoyW\u0026q=85\u0026s=14bdc45541d591c4de8138f16d71e725 2500w`}),`\n`,_jsx(Heading,{level:`2`,id:`targeted-injection-protection`,children:`Targeted injection protection`}),`\n`,_jsx(_components.p,{children:`Schema validation ensures requests are structurally correct, but some attacks rely on valid structure with malicious content.`}),`\n`,_jsx(_components.p,{children:`API Guardian allows you to combine schema enforcement with targeted deep inspection:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`Select specific `,_jsx(_components.strong,{children:`query`}),`, `,_jsx(_components.strong,{children:`path`}),`, `,_jsx(_components.strong,{children:`header`}),`, or `,_jsx(_components.strong,{children:`cookie`}),` parameters for inspection`]}),`\n`,_jsxs(_components.li,{children:[`Detect patterns like `,_jsx(_components.strong,{children:`SQL injection`}),` and `,_jsx(_components.strong,{children:`cross-site scripting (XSS)`})]}),`\n`,_jsx(_components.li,{children:`Apply deep inspection only where needed, reducing unnecessary overhead`}),`\n`]}),`\n`,_jsxs(Heading,{level:`3`,id:`schema-level-inspection-with-x-bunny-shield`,children:[`Schema-level inspection with `,_jsx(_components.code,{children:`x-bunny-shield`})]}),`\n`,_jsxs(_components.p,{children:[`You can also define inspection rules directly in your OpenAPI schema using the `,_jsx(_components.code,{children:`x-bunny-shield`}),` extension.`]}),`\n`,_jsx(_components.p,{children:`This allows you to attach detection logic to specific fields:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`8`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`8`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"properties\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"comment\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"type\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"string\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"x-bunny-shield\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"detectxss,detectsqli\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`Applies to `,_jsx(_components.code,{children:`string`}),` schema types`]}),`\n`,_jsxs(_components.li,{children:[`Accepts a comma-separated list of detectors (`,_jsx(_components.code,{children:`detectxss`}),`, `,_jsx(_components.code,{children:`detectsqli`}),`)`]}),`\n`,_jsx(_components.li,{children:`Enables field-level inspection without additional dashboard configuration`}),`\n`]}),`\n`,_jsx(OptimizedImage,{src:`https://mintcdn.com/bunnynet-cb9733c2/54-4KCQKoNVNuoyW/images/shield/api-guardian/injection-detection.png?fit=max\u0026auto=format\u0026n=54-4KCQKoNVNuoyW\u0026q=85\u0026s=458a362ee17e5adfe0efdcf6d5461c7d`,alt:``,\"data-og-width\":`1392`,width:`1392`,\"data-og-height\":`234`,height:`234`,\"data-path\":`images/shield/api-guardian/injection-detection.png`,\"data-optimize\":`true`,\"data-opv\":`3`,srcset:`https://mintcdn.com/bunnynet-cb9733c2/54-4KCQKoNVNuoyW/images/shield/api-guardian/injection-detection.png?w=280\u0026fit=max\u0026auto=format\u0026n=54-4KCQKoNVNuoyW\u0026q=85\u0026s=9be105c7b37e4eb5f7f55761d16897df 280w, https://mintcdn.com/bunnynet-cb9733c2/54-4KCQKoNVNuoyW/images/shield/api-guardian/injection-detection.png?w=560\u0026fit=max\u0026auto=format\u0026n=54-4KCQKoNVNuoyW\u0026q=85\u0026s=5341a559b57a8a56008ca3cec5d2c84f 560w, https://mintcdn.com/bunnynet-cb9733c2/54-4KCQKoNVNuoyW/images/shield/api-guardian/injection-detection.png?w=840\u0026fit=max\u0026auto=format\u0026n=54-4KCQKoNVNuoyW\u0026q=85\u0026s=24c20101dd5d7a416d051dca2168538b 840w, https://mintcdn.com/bunnynet-cb9733c2/54-4KCQKoNVNuoyW/images/shield/api-guardian/injection-detection.png?w=1100\u0026fit=max\u0026auto=format\u0026n=54-4KCQKoNVNuoyW\u0026q=85\u0026s=3b2c09dff416f697ac9f45581f0ea8ff 1100w, https://mintcdn.com/bunnynet-cb9733c2/54-4KCQKoNVNuoyW/images/shield/api-guardian/injection-detection.png?w=1650\u0026fit=max\u0026auto=format\u0026n=54-4KCQKoNVNuoyW\u0026q=85\u0026s=fe0b8832806522e51aea4975a4cda9eb 1650w, https://mintcdn.com/bunnynet-cb9733c2/54-4KCQKoNVNuoyW/images/shield/api-guardian/injection-detection.png?w=2500\u0026fit=max\u0026auto=format\u0026n=54-4KCQKoNVNuoyW\u0026q=85\u0026s=cebbe268040f6044f1f974bf66a4424c 2500w`}),`\n`,_jsx(Heading,{level:`2`,id:`built-into-the-edge-pipeline`,children:`Built into the edge pipeline`}),`\n`,_jsx(_components.p,{children:`API Guardian runs natively inside Bunny Shield’s request processing pipeline.`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`No additional network hops`}),`\n`,_jsx(_components.li,{children:`No external validation services`}),`\n`,_jsx(_components.li,{children:`Minimal latency impact`}),`\n`]}),`\n`,_jsx(_components.p,{children:`Validation happens alongside WAF, Bot Detection, and Rate Limiting, ensuring invalid traffic is filtered as early as possible.`}),`\n`,_jsx(Heading,{level:`2`,id:`limits-and-requirements`,children:`Limits and requirements`}),`\n`,_jsx(_components.p,{children:`API Guardian includes safeguards to ensure consistent performance:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Maximum OpenAPI spec size`}),`: 2 MB`]}),`\n`,_jsx(_components.li,{children:`Limits on schema complexity, nesting depth, and regex usage`}),`\n`,_jsxs(_components.li,{children:[`Supports `,_jsx(_components.strong,{children:`OpenAPI 3.0.x`}),` specifications`]}),`\n`]}),`\n`,_jsx(_components.p,{children:`Endpoint limits vary by plan:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Advanced`}),`: up to 10 endpoints`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Business`}),`: up to 50 endpoints`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Enterprise`}),`: customizable`]}),`\n`]}),`\n`,_jsx(_components.p,{children:`These limits help focus protection on critical and high-traffic endpoints.`}),`\n`,_jsx(Heading,{level:`2`,id:`logging-\u0026-observability`,children:`Logging \u0026 Observability`}),`\n`,_jsx(_components.p,{children:`API Guardian provides full visibility into validation activity:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Validation events`}),` logged for mismatched requests and responses`]}),`\n`,_jsx(_components.li,{children:`Clear insight into why a request was flagged or blocked`}),`\n`,_jsx(_components.li,{children:`Integrated into Bunny Shield’s event logs for real-time monitoring`}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`This makes it safe to start in `,_jsx(_components.strong,{children:`log mode`}),`, observe real traffic patterns, and switch to `,_jsx(_components.strong,{children:`blocking mode`}),` once you’re happy with the results.`]}),`\n`,_jsx(OptimizedImage,{src:`https://mintcdn.com/bunnynet-cb9733c2/54-4KCQKoNVNuoyW/images/shield/api-guardian/logs.png?fit=max\u0026auto=format\u0026n=54-4KCQKoNVNuoyW\u0026q=85\u0026s=46195fce2cee7dfa0ff8ba51514f6169`,alt:``,\"data-og-width\":`1687`,width:`1687`,\"data-og-height\":`984`,height:`984`,\"data-path\":`images/shield/api-guardian/logs.png`,\"data-optimize\":`true`,\"data-opv\":`3`,srcset:`https://mintcdn.com/bunnynet-cb9733c2/54-4KCQKoNVNuoyW/images/shield/api-guardian/logs.png?w=280\u0026fit=max\u0026auto=format\u0026n=54-4KCQKoNVNuoyW\u0026q=85\u0026s=b2570d64b463b522985a12c45b608a1e 280w, https://mintcdn.com/bunnynet-cb9733c2/54-4KCQKoNVNuoyW/images/shield/api-guardian/logs.png?w=560\u0026fit=max\u0026auto=format\u0026n=54-4KCQKoNVNuoyW\u0026q=85\u0026s=9c6380dd4401a184414e0ccd8081e377 560w, https://mintcdn.com/bunnynet-cb9733c2/54-4KCQKoNVNuoyW/images/shield/api-guardian/logs.png?w=840\u0026fit=max\u0026auto=format\u0026n=54-4KCQKoNVNuoyW\u0026q=85\u0026s=84e74e0c1218d5465fee17a7f5749654 840w, https://mintcdn.com/bunnynet-cb9733c2/54-4KCQKoNVNuoyW/images/shield/api-guardian/logs.png?w=1100\u0026fit=max\u0026auto=format\u0026n=54-4KCQKoNVNuoyW\u0026q=85\u0026s=b7a7945ae579b78dc2ed1a34e74a19d8 1100w, https://mintcdn.com/bunnynet-cb9733c2/54-4KCQKoNVNuoyW/images/shield/api-guardian/logs.png?w=1650\u0026fit=max\u0026auto=format\u0026n=54-4KCQKoNVNuoyW\u0026q=85\u0026s=7362b46b92d30360aa91e1aca93307d1 1650w, https://mintcdn.com/bunnynet-cb9733c2/54-4KCQKoNVNuoyW/images/shield/api-guardian/logs.png?w=2500\u0026fit=max\u0026auto=format\u0026n=54-4KCQKoNVNuoyW\u0026q=85\u0026s=977ebd8465253fcccfc6fdabe32d72ea 2500w`}),`\n`,_jsx(Heading,{level:`2`,id:`configuring-via-api`,children:`Configuring via API`}),`\n`,_jsx(_components.p,{children:`You can manage API Guardian configurations through the Bunny Shield API.`}),`\n`,_jsx(_components.p,{children:`This allows you to:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`Automate schema uploads`}),`\n`,_jsx(_components.li,{children:`Manage validation rules programmatically`}),`\n`,_jsx(_components.li,{children:`Integrate API protection into CI/CD workflows`}),`\n`]}),`\n`,_jsx(_components.p,{children:`By treating your OpenAPI schema as the source of truth, API Guardian enables consistent, automated security across all environments.`})]})}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":{"config":{},"pageMetadata":{"title":"API Guardian","description":"Schema-aware API protection. Bunny Shield enforces your OpenAPI contract at the edge so requests and responses match what your application expects.","href":"/shield/api-guardian"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Key Features","slug":"key-features","depth":2,"children":[]},{"title":"Schema-driven request validation","slug":"schema-driven-request-validation","depth":2,"children":[]},{"title":"Handling non-conforming requests","slug":"handling-non-conforming-requests","depth":2,"children":[{"title":"Rule execution mode","slug":"rule-execution-mode","depth":3,"children":[]},{"title":"Unmatched path handling","slug":"unmatched-path-handling","depth":3,"children":[]},{"title":"Authentication-aware path handling","slug":"authentication-aware-path-handling","depth":3,"children":[]}]},{"title":"Response validation","slug":"response-validation","depth":2,"children":[]},{"title":"Authentication enforcement at the edge","slug":"authentication-enforcement-at-the-edge","depth":2,"children":[{"title":"Token validation","slug":"token-validation","depth":3,"children":[]}]},{"title":"Per-endpoint rate limiting","slug":"per-endpoint-rate-limiting","depth":2,"children":[]},{"title":"Targeted injection protection","slug":"targeted-injection-protection","depth":2,"children":[{"title":"Schema-level inspection with x-bunny-shield","slug":"schema-level-inspection-with-x-bunny-shield","depth":3,"children":[]}]},{"title":"Built into the edge pipeline","slug":"built-into-the-edge-pipeline","depth":2,"children":[]},{"title":"Limits and requirements","slug":"limits-and-requirements","depth":2,"children":[]},{"title":"Logging \u0026 Observability","slug":"logging-\u0026-observability","depth":2,"children":[]},{"title":"Configuring via API","slug":"configuring-via-api","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"bunnynet-cb9733c2","siteName":"bunny.net Documentation","title":"API Guardian - bunny.net Documentation","relatedPagesConfig":{"enabled":false,"limit":5,"mode":"automatic"},"navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-07-30T15:28:19.102Z","gitLastModified":"2026-05-19T11:35:23.000Z","originalFileLocation":"shield/api-guardian.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=\"system\"}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=\"Schema-aware API protection. Bunny Shield enforces your OpenAPI contract at the edge so requests and responses match what your application expects.\">\u003cmeta data-mint-head name=\"application-name\" content=\"bunny.net Documentation\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/docs/mintlify-assets/_mintlify/favicons/bunnynet-cb9733c2/Zv4NOenQlgPS3TXm/_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=\"/docs/mintlify-assets/_mintlify/favicons/bunnynet-cb9733c2/Zv4NOenQlgPS3TXm/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/docs/mintlify-assets/_mintlify/favicons/bunnynet-cb9733c2/Zv4NOenQlgPS3TXm/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/docs/mintlify-assets/_mintlify/favicons/bunnynet-cb9733c2/Zv4NOenQlgPS3TXm/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/docs/mintlify-assets/_mintlify/favicons/bunnynet-cb9733c2/Zv4NOenQlgPS3TXm/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/docs/mintlify-assets/_mintlify/favicons/bunnynet-cb9733c2/Zv4NOenQlgPS3TXm/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/docs/mintlify-assets/_mintlify/favicons/bunnynet-cb9733c2/Zv4NOenQlgPS3TXm/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/docs/mintlify-assets/_mintlify/favicons/bunnynet-cb9733c2/Zv4NOenQlgPS3TXm/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/docs/mintlify-assets/_mintlify/favicons/bunnynet-cb9733c2/Zv4NOenQlgPS3TXm/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"API Guardian - bunny.net Documentation\">\u003cmeta data-mint-head property=\"og:description\" content=\"Schema-aware API protection. Bunny Shield enforces your OpenAPI contract at the edge so requests and responses match what your application expects.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"bunny.net Documentation\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://bunny.net/docs/shield/api-guardian\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://bunnynet-cb9733c2.mintlify.app/_mintlify/api/og/v2?division=Protection+Features\u0026amp;title=API+Guardian\u0026amp;description=Schema-aware+API+protection.+Bunny+Shield+enforces+your+OpenAPI+contract+at+the+edge+so+requests+and+responses+match+what+your+application+expects.\u0026amp;theme=3e3fa11ba94222b95e7f52d5\u0026amp;signature=c5c40570ec37097c4ba3ed7bfb74a1ad3c60bc024710c894378d43ec941c4abd\">\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=\"API Guardian - bunny.net Documentation\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Schema-aware API protection. Bunny Shield enforces your OpenAPI contract at the edge so requests and responses match what your application expects.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://bunnynet-cb9733c2.mintlify.app/_mintlify/api/og/v2?division=Protection+Features\u0026amp;title=API+Guardian\u0026amp;description=Schema-aware+API+protection.+Bunny+Shield+enforces+your+OpenAPI+contract+at+the+edge+so+requests+and+responses+match+what+your+application+expects.\u0026amp;theme=3e3fa11ba94222b95e7f52d5\u0026amp;signature=c5c40570ec37097c4ba3ed7bfb74a1ad3c60bc024710c894378d43ec941c4abd\">\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=\"/docs/mintlify-assets/_mintlify/favicons/bunnynet-cb9733c2/Zv4NOenQlgPS3TXm/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"bunny.net Documentation\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#EF6126\">\u003clink data-mint-head rel=\"canonical\" href=\"https://bunny.net/docs/shield/api-guardian\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/docs/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/docs/shield/api-guardian.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://bunny.net/#organization\",\"name\":\"bunny.net Documentation\",\"url\":\"https://bunny.net\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/bunnynet-cb9733c2/54-4KCQKoNVNuoyW/logo/bunny-logo-dark.svg?fit=max\u0026auto=format\u0026n=54-4KCQKoNVNuoyW\u0026q=85\u0026s=62c091ea1aaea93d0a981902b7783e37\"}},{\"@type\":\"WebSite\",\"@id\":\"https://bunny.net/docs#website\",\"name\":\"bunny.net Documentation\",\"url\":\"https://bunny.net/docs\",\"publisher\":{\"@id\":\"https://bunny.net/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://bunny.net/docs/shield/api-guardian#webpage\",\"url\":\"https://bunny.net/docs/shield/api-guardian\",\"name\":\"API Guardian\",\"description\":\"Schema-aware API protection. Bunny Shield enforces your OpenAPI contract at the edge so requests and responses match what your application expects.\",\"dateModified\":\"2026-05-19T11:35:23.000Z\",\"isPartOf\":{\"@id\":\"https://bunny.net/docs#website\"},\"breadcrumb\":{\"@id\":\"https://bunny.net/docs/shield/api-guardian#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://bunny.net/docs/shield/api-guardian#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Protection Features\",\"item\":\"https://bunny.net/docs/shield/waf\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"API Guardian\",\"item\":\"https://bunny.net/docs/shield/api-guardian\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://bunny.net/docs/shield/api-guardian#article\",\"headline\":\"API Guardian\",\"name\":\"API Guardian\",\"description\":\"Schema-aware API protection. Bunny Shield enforces your OpenAPI contract at the edge so requests and responses match what your application expects.\",\"url\":\"https://bunny.net/docs/shield/api-guardian\",\"mainEntityOfPage\":{\"@id\":\"https://bunny.net/docs/shield/api-guardian#webpage\"},\"dateModified\":\"2026-05-19T11:35:23.000Z\",\"publisher\":{\"@id\":\"https://bunny.net/#organization\"},\"isPartOf\":{\"@id\":\"https://bunny.net/docs#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"bunny.net Documentation\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"bunny.net Documentation","nav":{"global":null,"products":[{"product":"Home","icon":"book-open","pages":[{"title":"Home","href":""}]},{"product":"CDN","icon":"zap","description":"Accelerate and protect your content globally","pages":[{"title":"CDN","href":"/cdn"}]},{"product":"Magic Containers","icon":"box","description":"Deploy any app anywhere with Docker","pages":[{"title":"Magic Containers","href":"/magic-containers"}]},{"product":"Edge Scripting","icon":"code","description":"Deploy serverless code at the edge","pages":[{"title":"Edge Scripting","href":"/scripting"}]},{"product":"Stream","icon":"video","description":"Video streaming and delivery platform","pages":[{"title":"Stream","href":"/stream"}]},{"product":"Storage","icon":"hard-drive","description":"Global object storage","pages":[{"title":"Storage","href":"/storage"}]},{"product":"Shield","icon":"shield","description":"Stay protected and online no matter what","tabs":[{"tab":"Documentation","groups":[{"group":"Documentation","pages":[{"title":"Bunny Shield","sidebarTitle":"Introduction","mode":"wide","href":"/shield"},{"title":"Quickstart","href":"/shield/quickstart"},{"title":"Pricing","href":"/shield/pricing"},{"title":"Bunny Shield Changelog","sidebarTitle":"Changelog","url":"/changelog?tags=Shield","href":"/shield/changelog"}]},{"group":"Protection Features","pages":[{"group":"WAF","pages":[{"title":"WAF","sidebarTitle":"Overview","href":"/shield/waf"},{"title":"Understanding Rule Engine","href":"/shield/rule-engine"},{"title":"Creating a custom WAF rule","href":"/shield/custom-waf-rule"}]},{"group":"Rate Limiting","pages":[{"title":"Rate Limiting","sidebarTitle":"Overview","href":"/shield/rate-limiting"},{"title":"Creating a rate limit rule","href":"/shield/custom-rate-limit-rule"}]},{"title":"DDoS Mitigation","href":"/shield/ddos"},{"title":"Bot Detection","href":"/shield/bot-detection"},{"title":"Access Lists","href":"/shield/access-lists"},{"title":"Upload Scanning","description":"Keep your platform safe from harmful uploads. Automatically scan files for viruses, malware, and CSAM to stop threats before they spread.","href":"/shield/upload-scanning"},{"title":"API Guardian","href":"/shield/api-guardian"}]},{"group":"Reference","pages":[{"title":"Custom Response Pages","description":"Customize the challenge, block, and rate limit response pages shown to visitors when Bunny Shield takes action. Create fully branded experiences that match your website while maintaining Bunny Shield protection.","href":"/shield/custom-response-pages"},{"title":"Verified Bots","href":"/shield/verified-bots"},{"title":"Metrics \u0026 Logging","href":"/shield/metrics"},{"title":"Cookies","href":"/shield/cookies"},{"title":"Troubleshooting","href":"/shield/troubleshooting"},{"title":"API Reference","url":"/api-reference/shield","href":"/shield/api-reference"}]}]}]},{"product":"Optimizer","icon":"sparkles","description":"Automatic image and web optimization.","pages":[{"title":"Optimizer","href":"/optimizer"}]},{"product":"DNS","icon":"globe","description":"Unlock the true power of DNS with an ultra-fast scriptable platform","pages":[{"title":"DNS","href":"/dns"}]},{"product":"Database","icon":"database","description":"Serverless SQLite over HTTP","pages":[{"title":"Database","href":"/database"}]},{"product":"Integrations","icon":"puzzle","description":"Official and third-party plugins and integrations","pages":[{"title":"Integrations","href":"/integrations/wordpress"}]},{"product":"CLI","icon":"terminal","description":"Manage bunny.net from your terminal","pages":[{"title":"CLI","href":"/cli"}]},{"product":"API Reference","icon":"square-terminal","description":"Build \u0026 Integrate with the Platform API","pages":[{"title":"API Reference","href":"/api-reference"}]},{"product":"Partners","icon":"handshake","description":"Manage customers, pricing, and billing as a bunny.net partner","pages":[{"title":"Partners","href":"/partners"}]}]},"basePath":"","title":"API Guardian - bunny.net Documentation","buildId":"dpl_4RHMRqtvdHvKgaEfTTjFqjzja3B6","deploymentId":"dpl_4RHMRqtvdHvKgaEfTTjFqjzja3B6","dynamics":["a74be98ba7"],"chunks":["zoom-image-lightbox-CZTaVDTN.js","lightbox-handle-r17bVUz3.js"]}