> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://documents.pyramid-ai.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://documents.pyramid-ai.com/_mcp/server.

# Compliance Checking

## What is compliance checking?

Compliance checking answers a simple question: **"Does our project documentation satisfy this requirement?"**

You provide a requirement (e.g., "The site must have a documented fire safety plan") and Pyramid Check searches your project documents for evidence, then delivers a verdict: **compliant** or **non-compliant**, with citations.

## Two ways to check

### Quick Verify — one requirement at a time

`POST /api/v2/check/verify`

Submit a single requirement and get an immediate verdict. The fastest way to check something.

```
Requirement: "Emergency exits must be clearly marked"
        │
        ▼
┌──────────────────────────────────────────┐
│ Search project documents for evidence     │
│ Analyze whether the requirement is met    │
│ Generate verdict with citations           │
└──────────────────────────────────────────┘
        │
        ▼
Verdict: Compliant
Confidence: 92%
Evidence: "Section 4.3 of the Safety Plan states..."
Sources: Safety-Plan-2026.pdf, page 12
```

**Response structure:**

```json
{
  "data": {
    "verdict": "compliant",
    "confidence": 0.92,
    "evidence": "Section 4.3 of the Safety Plan states that all emergency exits...",
    "explanation": "The project documentation includes a detailed emergency exit marking plan...",
    "recommendation": null,
    "sources": [
      { "title": "Safety-Plan-2026.pdf", "relevance": 0.95 }
    ]
  }
}
```

| Field            | What it tells you                                                                         |
| ---------------- | ----------------------------------------------------------------------------------------- |
| `verdict`        | `compliant` or `non-compliant`                                                            |
| `confidence`     | How certain the AI is (0 to 1). Below 0.7 suggests the documents may not cover this topic |
| `evidence`       | The specific text from your documents that supports the verdict                           |
| `explanation`    | Plain-language reasoning for the decision                                                 |
| `recommendation` | What to do if non-compliant (null if compliant)                                           |
| `sources`        | Which documents and sections were referenced                                              |

**Best for:** Spot checks, quick lookups, integrating compliance into other workflows (e.g., an Excel column that shows pass/fail).

### Compliance Runs — many requirements at once

For audits and systematic reviews, use compliance runs to check dozens or hundreds of requirements in a single batch.

**The workflow:**

```
1. Create a run          2. Trigger processing       3. Get results
   (define requirements)    (start the checks)          (per-requirement verdicts)

POST /check/runs         POST /check/runs/{id}       GET /check/runs/{id}
                              /trigger                GET /check/runs/{id}
                                                           /requirements
```

#### Create the run

Define what you're checking — a name, the project to check against, and a list of requirements.

```bash
curl -X POST https://api.pyramid-ai.com/api/v2/check/runs \
  -H "Authorization: Bearer pai_live_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "project_id": "YOUR_PROJECT_ID",
    "name": "Q2 2026 Fire Safety Audit",
    "requirements": [
      "The site must have a documented fire safety plan",
      "Fire extinguishers must be inspected monthly",
      "Emergency evacuation routes must be posted on every floor",
      "Fire drills must be conducted quarterly"
    ]
  }'
```

This creates the run but **does not start processing** — giving you a chance to review before committing.

#### Trigger processing

When you're ready, start the check:

```bash
curl -X POST https://api.pyramid-ai.com/api/v2/check/runs/RUN_ID/trigger \
  -H "Authorization: Bearer pai_live_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```

The system works through each requirement, searching the project documents and generating verdicts.

#### Monitor progress

Check the run status — the counters update as requirements are processed:

```bash
curl https://api.pyramid-ai.com/api/v2/check/runs/RUN_ID \
  -H "Authorization: Bearer pai_live_YOUR_KEY"
```

```json
{
  "data": {
    "status": "processing",
    "total_requirements": 4,
    "processed_requirements": 2,
    "passed_requirements": 1,
    "failed_requirements": 1
  }
}
```

#### Get results

Once the run is complete, retrieve the individual verdicts:

```bash
curl https://api.pyramid-ai.com/api/v2/check/runs/RUN_ID/requirements \
  -H "Authorization: Bearer pai_live_YOUR_KEY"
```

Each requirement has its own verdict, confidence score, evidence, and sources — just like Quick Verify.

**Best for:** Quarterly audits, tender compliance reviews, systematic gap analysis, regulatory reporting.

## When to use which

| Scenario                                             | Use                |
| ---------------------------------------------------- | ------------------ |
| "Does this project have a fire safety plan?"         | **Quick Verify**   |
| "Check these 50 requirements from the building code" | **Compliance Run** |
| An Excel cell that shows pass/fail for a requirement | **Quick Verify**   |
| A quarterly audit report across all safety standards | **Compliance Run** |
| A mobile app flagging issues on site                 | **Quick Verify**   |
| Pre-submission tender compliance check               | **Compliance Run** |

## Understanding confidence scores

The confidence score tells you how certain the AI is about its verdict:

| Score     | Interpretation                            | Action                                               |
| --------- | ----------------------------------------- | ---------------------------------------------------- |
| 0.9 - 1.0 | High confidence — clear evidence found    | Trust the verdict                                    |
| 0.7 - 0.9 | Moderate confidence — partial evidence    | Review the sources manually                          |
| Below 0.7 | Low confidence — topic may not be covered | Your documents likely don't address this requirement |

> **Note**
>
> A low confidence score doesn't always mean non-compliant. It often means the AI couldn't find enough relevant content in your documents to make a strong determination. Consider uploading additional documents.

## Tips for better compliance results

* **Write clear requirements** — "Fire exits must be marked with illuminated signs" is better than "fire exit compliance"
* **Upload the right handbooks** — if you're checking against a specific standard, make sure that standard's document is in the project
* **One requirement per item** — don't combine multiple checks into one requirement. "Fire exits must be marked AND inspected monthly" should be two separate requirements
* **Use runs for audits** — individual verify calls are great for spot checks, but runs give you a structured report