# LangGraph + Salesforce Check Write

Stop a LangGraph agent before the wrong Salesforce update.

## Problem

An agent can have Salesforce credentials and still make the wrong business change.

## Before

```
Agent → Salesforce update
```

## After

```
Agent → Check Write → Salesforce update only on ALLOW
```

## Modes: Try → Build → Protect

| Mode | Key | Endpoint |
|------|-----|----------|
| **Sandbox** | None | Local mock in this example |
| **Developer** | Free `tc_dev_…` from [Get Developer Key](https://tekcapitol.com/developers/get-key.html) | `POST https://tekcapitol.com/api/v1/check-write` |
| **Production** | TC Protect™ production key | Same public facade (enterprise policy / Trace / Detect) |

You do **not** need a TC Protect Live entitlement to run the development example.

## Run (~5 minutes)

```bash
cd examples/langgraph-salesforce-check-write
python3 -m venv .venv
source .venv/bin/activate   # Windows: .venv\Scripts\activate
pip install -r requirements.txt
cp .env.example .env
# Sandbox (default): leave TEKCAPITOL_API_KEY empty
# Developer: set TEKCAPITOL_API_KEY=tc_dev_… from /developers/get-key
python example.py
```

Optional env:

```
CHECK_WRITE_MODE=sandbox|developer|production
TEKCAPITOL_API_URL=https://tekcapitol.com/api/v1/check-write
TEKCAPITOL_API_KEY=
```

Auth header for developer / production:

```
Authorization: Bearer $TEKCAPITOL_API_KEY
```

## Result

| Decision | Behavior |
|----------|----------|
| ALLOW | Calls the fake Salesforce update helper |
| PAUSE | Does not update; surfaces review state |
| BLOCK | Stops the action |

## Docs

Schema: https://tekcapitol.com/docs/write-intent/  
API: https://tekcapitol.com/docs/check-write/  
Playground: https://tekcapitol.com/check-write  
Dashboard: https://tekcapitol.com/developers/dashboard.html

## Notes

* Your application still performs the write. TekCapitol decides immediately before it.
* This is a called gate, not Salesforce man-in-the-middle.
* Do not put production secrets in source control.
* Free developer tier is for evaluation. Production assurance is TC Protect™.
