> ## Documentation Index
> Fetch the complete documentation index at: https://docs.regpilot.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Governor - AI Response Validation

> Premium AI compliance validation that checks every response before delivery

## Governor

Governor is RegPilot's premium feature that validates every AI-generated response for legal and policy violations **before** they reach end users.

<Note>
  **Premium Feature**: Governor requires the Pro plan (\$300/month). [Upgrade now](https://regpilot.dev/pricing)
</Note>

## How Governor Works

<Steps>
  <Step title="AI Generates Response">
    Your AI model (GPT-4, Claude, etc.) creates a response
  </Step>

  <Step title="Governor Validates">
    Response is checked against:

    * EU AI Act requirements
    * GDPR compliance
    * Custom policies
    * Bias detection
    * Prohibited content
  </Step>

  <Step title="Risk Scoring">
    Governor assigns a risk score (0-100):

    * 0-30: Low risk (auto-approve)
    * 31-70: Medium risk (review recommended)
    * 71-100: High risk (block or require approval)
  </Step>

  <Step title="Action Taken">
    Based on your settings:

    * **Auto-approve**: Low-risk responses delivered immediately
    * **Flag for review**: Medium-risk responses logged
    * **Block**: High-risk responses prevented
  </Step>
</Steps>

## Enabling Governor

```typescript theme={null}
const response = await fetch('https://regpilot.dev/api/ai/chat', {
  method: 'POST',
  headers: {
    'X-API-Key': process.env.REGPILOT_API_KEY,
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    messages: [{ role: 'user', content: 'User question' }],
    // Add Governor metadata
    governorMetadata: {
      actionType: 'customer_support',
      recipientCountry: 'DE',
      senderId: 'agent_123',
      contextTags: ['refund', 'complaint']
    }
  })
});

// Check validation results
const riskScore = response.headers.get('X-Governor-Risk-Score');
const validated = response.headers.get('X-Governor-Validated');
const violations = response.headers.get('X-Governor-Violations');
```

## Validation Checks

### Legal Compliance

* EU AI Act high-risk categories
* GDPR personal data protection
* Consumer protection laws
* Financial advice regulations

### Content Safety

* Discrimination and bias
* Harmful content
* Misinformation
* Age-inappropriate material

### Custom Policies

* Company-specific rules
* Industry regulations
* Brand guidelines
* Tone requirements

## Configuration

### Risk Thresholds

```typescript theme={null}
await regpilot.governor.configure({
  autoApproveThreshold: 30,
  blockThreshold: 70,
  strictMode: false,
  notifyOnMediumRisk: true
});
```

### Custom Rules

```typescript theme={null}
await regpilot.governor.addRule({
  name: "No Financial Advice",
  condition: {
    contains: ["invest", "stock", "financial advice"]
  },
  action: "block",
  severity: "high"
});
```

## Response Headers

Every Governor-validated response includes:

```typescript theme={null}
{
  'X-Governor-Validated': 'true',
  'X-Governor-Risk-Score': '25',
  'X-Governor-Violations': '0',
  'X-Governor-Audit-Id': 'audit_abc123',
  'X-Governor-Processing-Time': '145ms'
}
```

## Pricing

Governor is available on Pro and Enterprise plans:

* **Pro**: \$300/month + usage costs
* **Enterprise**: Custom pricing

Includes:

* Unlimited validations
* All compliance frameworks
* Custom policy rules
* Priority support

## Next Steps

<CardGroup cols={2}>
  <Card title="Enable Governor" icon="toggle-on" href="https://regpilot.dev/settings/governor">
    Activate in your dashboard
  </Card>

  <Card title="API Reference" icon="code" href="/api-reference/governor/validate">
    Governor API documentation
  </Card>
</CardGroup>
