Why guardrails matter
Traditional security tools run after code is committed—by then, the vulnerability exists and requires remediation. Corridor’s guardrails shift security left by integrating directly into the AI code generation process:- Prevention over detection: Security context guides the AI to avoid vulnerable patterns
- Zero developer friction: No separate security review step—it happens during coding
- Reduced remediation costs: Fixing a vulnerability before it’s written costs nothing
How guardrails work
Guardrails operate through MCP and Hooks, which allow Corridor to participate in AI interactions:- Developer prompts AI: “Write a function to query the database”
- Corridor analyzes context: Project type, existing code patterns, security policies
- Security context provided: Guardrails inform the AI about relevant risks (e.g., SQL injection, parameterized queries)
- AI generates secure code: The response incorporates security best practices
- Activity logged: The interaction is recorded for audit and analytics
- During code generation: Guardrails provide additional context to AI models (via MCP) so the AI avoids insecure suggestions. This happens invisibly as you code
- During code review: Guardrails run as checks on code diffs in pull requests. If code in a PR violates a guardrail, Corridor catches it and flags it for review
Configuring guardrails
By default, Corridor applies the Corridor Default Security Pack: a comprehensive pack of essential security guardrails covering common vulnerability classes including injection attacks, authentication issues, and access control flaws. Corridor also provides pre-loaded security packs tailored to specific languages, app types, and standards. Teams can create custom packs on the Team Guardrails page comprised of guardrails unique to their needs. See Configuring Guardrails for detailed instructions on setting up default packs, custom guardrails, and custom context.Managing guardrails via AI assistant
If you have the Corridor MCP integration set up, your AI assistant can interact with guardrails directly:- View guardrails: Ask your AI “What guardrails should I follow?” and it will call Corridor’s
getGuardrailstool to retrieve security guardrails and context documents for the project - Create guardrails: Tell your AI “Create a guardrail for SQL injection prevention” and it will call
createGuardrailto create a new guardrail programmatically