# Setup guide — Company Policy Q&A Agent

## 1. Install and connect the policy corpus

Install the agent and connect it to your official policy documents.

```
pipx install policy-qa-agent
policy-qa-agent connect --docs sharepoint://hr-policies
policy-qa-agent doctor   # verifies sources + versioning
```

## 2. Configure grounding and escalation

Source-only answers and sensitive-topic routing are enforced here.

```
cp .env.example .env
ANTHROPIC_API_KEY=sk-ant-...
ANSWER_FROM_SOURCE_ONLY=true
CITE_REQUIRED=true
ESCALATE_SENSITIVE_TO=HR
```

## 3. Define sensitive categories & contacts

Tell it what to route and to whom.

```
# policy-qa.yml
sensitive: [harassment, discrimination, medical_leave, accommodation, pay_dispute, complaint, safety]
contacts: { HR: hr@company.com, benefits: benefits@company.com }
no_advice: [legal, medical, tax, financial]
```

## 4. Test against known answers

Verify it cites correctly and says 'not covered' when it should.

```
policy-qa-agent eval --set ./qa-pairs.json --explain
# checks citation accuracy + fabrication rate (must be 0) + sensitive routing
```

## 5. Wire into onboarding/help

Embed in your onboarding portal or chat; sensitive items route to HR.

```
# employee chat -> grounded cited answers; sensitive/uncovered -> HR with context
```
