# Frequently asked questions
Source: https://docs.getpostern.com/about/faq
What Postern is, where your data lives, what an agent can reach, and what ships today.
## What Postern is
### Is Postern an AI agent?
No. Postern has no model inside it. Your agents decide what to do. Postern checks who
they are, holds your data, answers with the slice they asked for, and records the
request.
[Some reads you make yourself in the Console deliberately get no row.](/reference/audit-log#what-does-not-get-a-row)
### Is Postern open source?
Yes — Apache-2.0, and it's the complete gateway: every connector, reads and actions,
MCP and REST access, the Console, permissions and audit. You can build on it and ship
what you build on any terms you like. Nothing here is a crippled tier: the open core is
the product, not a demo of it.
Apache rather than a copyleft licence for one reason: a connector or an agent written
against this gateway should be publishable by anyone, on any terms they like, including
inside a closed product.
## Your data
### Where does my data live?
On hardware you own: a local database, beside an encrypted vault that holds your source
passwords.
Mail is the exception. Postern stores who sent it, the subject, the dates and the
preview line. It never stores the message text. It fetches a message from the source
when an agent asks for it.
You can [export everything as JSON, or erase everything](/operate/backup-and-export),
at any time.
### Does Postern give agents my source passwords?
Never. Each agent gets its own key, and Postern keeps only a scrambled copy of that
key.
[What the vault does and does not cover](/reference/vault)
Isn't one machine with everything on it a bigger target?
You already have that exposure, spread out. Every agent holds its own copy of your
source passwords, plus whatever you pasted in. Postern puts that in one place built
for the job.
[What Postern encrypts, what it does not, and where the trust boundary sits](/reference/security-model#the-trust-boundary)
## Agents, keys and grants
### Can I use it with any agent?
Any agent that speaks MCP. On the same machine it sends its agent key on every call.
Hosted agents like claude.ai and ChatGPT sign in to Postern itself and hold a token
that rotates.
Every read is also on a REST API, for tools that do not speak MCP. To act on a source,
an agent must use MCP.
[The REST mirror carries reads only.](/reference/mcp-primitives#the-rest-read-mirror)
### Does an agent receive my entire life?
No. A new key can reach nothing until you tick a sector. Inside one it asks for what it
needs: named records, named fields, a date range, or a total. It never gets a dump.
### What happens when I revoke an agent?
Click **Agents & keys**, the agent, **Revoke**, then **Revoke the key**. Postern
refuses the key at once and cuts any session the agent still holds. Nothing upstream
changes, and you never have to change a source password.
[Revoking, rotating, and removing](/reference/agent-keys#revoking-rotating-and-removing)
## What ships, and what comes later
### What ships today?
Nine connectors across all six sectors — eight sources to connect, because Gmail and
the rest of Google connect separately.
* **Finance** — [SimpleFIN](/connect/simplefin), [Plaid](/connect/plaid)
* **Mail, calendar and contacts** — [Google and Gmail](/connect/google), [Microsoft](/connect/microsoft), [iCloud](/connect/icloud)
* **Health** — [Apple Health](/connect/apple-health), [WHOOP](/connect/whoop)
* **Home** — [Home Assistant](/connect/home-assistant)
Postern reads from all eight. Home Assistant is the only one an agent can act on; the
other seven have no actions today.
Also shipped:
* MCP for any agent, and a REST copy of every read
* the Console
* per-agent grants
* the record
* a live fetch from a source
* the vault
### What comes later?
Shared access between people, memory you own, connectors other people write, and
specialist agents that charge for their craft. All are on
[the roadmap](https://getpostern.com/#roadmap). None is in the beta.
### What will cost money?
Nothing you need to run Postern yourself: the open core stays free forever. Paid tiers
add memory you own, shared access over a hosted relay, a managed OAuth broker, and a
hosted Postern we run for you. Prices come after the beta.
## Next
Docker and a terminal · about 10 minutes · no cloud account
# Connect Apple Health
Source: https://docs.getpostern.com/connect/apple-health
Your iPhone pushes health data to an address the Console creates for it. Postern never pulls, and keeps what your phone sends from the day you start.
**Before you start**
* **An iPhone, and the Health Auto Export app** from the App Store. Its REST API
automations may need the app's paid tier. That is the app's paywall, not Postern's.
* **Remote access, set up first.** Postern only answers requests from the machine it
runs on. Your phone is a different machine, so
[open two ports to your own devices](/start/remote-access#your-devices) first.
Tailscale's private tier is enough. Nothing has to be public.
* **Postern is up, with the Console open at `http://localhost:8787`.** Otherwise
[install Postern](/start/install) first. Allow about 10 minutes, plus your first
export.
* **Your password manager open.** The Console shows the device secret once.
Open the Console at `http://localhost:8787`. Go to **Sources** → **Add a source** →
**Apple Health**.
Postern cannot show you this secret again. It keeps a scrambled copy it can check
against, never the secret itself. If you lose it, press **Rotate secret** on the
connection. That makes a new secret and stops every device that still sends the old one.
Open your password manager before you press the button.
Press **Create your ingest endpoint**. The card returns two values, then reads
*waiting for the first push*:
* **Ingest path** — `/api/ingest/`
* **Device secret — shown once**
Copy the secret into your password manager now.
The ingest path is not a web address. Postern is never told your remote-access address,
so you build the address yourself:
1. On the machine Postern runs on, run `tailscale status`. Read its Tailscale name. It
looks like `gateway.example-tailnet.ts.net`.
2. Put `https://`, that name and `:8443` in front of the path, exactly as the Console
printed it. Port 8443 is the port you opened in
[Open two ports to your own devices](/start/remote-access#your-devices).
```text theme={"system"}
https://gateway.example-tailnet.ts.net:8443/api/ingest/
```
Copy that address. It goes into your phone in step 3.
Any address you put in front of the path works. The secret is what protects it.
[The ingest route is the one route Postern serves without a host check](/reference/ports#the-push-ingest-route).
The Console prints the same example with its own placeholder host,
`your-mac.tailnet.ts.net:8443`. Both host names are fake. Use yours.
Leave this screen and the address stays. The connection page shows it again under
**Delivery** → **Ingest endpoint**, with a copy control. Only the secret is one-time.
Come back here once a connection exists and the card reads *A device is already pushing
Health data here. Create another endpoint only if you’re adding a second device.* Tick
*Yes — create a second ingest endpoint.* and the button reads **Create another
endpoint**. Take it literally: that is a second connection for a second device, not a
repair. To fix the phone you already have, use **Rotate secret** instead.
On the iPhone, open the App Store and install **Health Auto Export**. Open the app.
On first launch it asks for access to Apple Health. Grant every category you want
exported. Without that access every export is empty, and every step after this one
still looks like it worked.
The app carries an **Automations** tab. The next three steps happen there.
Any program that can POST Postern's JSON body with the secret in a header works. The
Console's Apple Health card carries that body under *The JSON body Postern expects*,
with a **Copy the template** button. The same card describes an iPhone Shortcut built
from a *Get Contents of URL* step. Four rules decide whether a payload lands:
* Each `metrics[].name` becomes a metric type.
* The metric named `sleep_analysis` becomes a sleep session.
* Every entry under `workouts[]` needs its own `id`.
* Dates are `yyyy-MM-dd HH:mm:ss ±hhmm`, not ISO. Postern skips a point it cannot
date. It never stores one wrong.
The rest of this page uses the app. That is the path that runs in production.
Open the **Automations** tab and press **New Automation**. Set **Automation Type** to
**REST API**. The automation screen opens.
Put the address you copied in step 1 into **URL**.
Under **Add Headers**, add one header. Its name is `Authorization`. Its value is
`Bearer ` — the word `Bearer`, one space, then the secret from step 1. A header
named `X-PCI-Webhook-Secret` with the secret alone as its value works too, and it is the
one the Console names.
Under **Data Type Settings**, open **Data Type** and choose health metrics. An exported
automation records that choice as `"exportDataType": "healthMetrics"`.
Set the export version to v2 before you save. Postern reads the shape v2 sends: one
`data` object that holds `metrics` and `workouts`. Postern refuses a body that carries no
`data` object at all. Nobody has ever tested a push from an older export version, so
leave it on v2.
Set the rest to match the phone that runs in production. The names below are the ones
Health Auto Export writes into an exported automation, with the values that phone exports:
```json theme={"system"}
{
"exportDestination": "restApi",
"exportDataType": "healthMetrics",
"exportFormat": "JSON",
"exportVersion": "ExportVersion.v2",
"exportFileLength": "day",
"exportPeriod": "Default",
"exportAggregation": "Default",
"batchRequests": false,
"aggregateData": true,
"aggregateSleep": true,
"includeHealthMetrics": true,
"includeWorkouts": false,
"includeCycleTracking": true,
"includeMedications": true,
"includeWorkoutMetadata": true,
"includeRoutes": true,
"includeECG": false,
"includeHeartRateNotifications": false,
"includeStateOfMind": false,
"includeSymptoms": false,
"requestTimeout": 86400
}
```
**Automations**, **New Automation**, **Automation Type**, **REST API**, **URL**, **Add
Headers**, **Data Type Settings**, **Data Type** and **Timeout Interval** are the app's
own words, read off a capture of the phone in production on 1 August 2026.
Nobody has recorded what the app calls the settings in the block above. Those are the key
names an exported automation uses. Match them by what they do, and trust your screen over
this page. `requestTimeout` is the app's **Timeout Interval** field.
Select every metric. A day of metrics stays small. The app writes each name into the
automation one by one, and the phone in production lists 113 of them. It stores a list, not
a wildcard, so an app update that adds a new metric does not pick it up on its own — come
back and tick it.
Leave `exportFileLength` on `day` and `batchRequests` off. Postern refuses any
single push over 25 MB with `{"error":"payload too large"}`, and nothing in a refused push
lands. One day at a time has never come close on the phone in production.
Both aggregation settings change what an agent gets. Turn them on anyway — this is the
pair the phone in production runs, and it has been healthy for weeks — but know the price.
`aggregateData: true` changes the names. A point that carries a plain `qty` becomes one
row under ``. A point that carries Min, Avg or Max instead becomes one row per
statistic present: `_min`, `_avg`, `_max`. In production this happens to
exactly one metric, heart rate: that store holds `heart_rate_min`, `heart_rate_avg` and
`heart_rate_max`, and no `heart_rate` at all. An agent that asks for `heart_rate` gets
nothing back. Postern tags every fanned row `aggregation: daily_total`, even when the
value covers one minute. Never sum those rows across a day.
`aggregateSleep: true` costs you the sleep numbers. Postern reads a night's length from
two fields that the aggregated shape leaves at `0`, so a sleep session stores
`time_asleep_seconds` `0`, `time_in_bed_seconds` `0` and an empty `efficiency_pct`. The
start and the end are right, and the real total survives under `raw` as `totalSleep`, in
hours. An agent works the night's length out from the start and the end.
The automation exists once it appears in the automations list. Nothing reaches Postern
until it runs.
An exported automation carries your live address and secret in its JSON, in plain text,
on disk wherever you export it. Share one and you hand someone a live key to your health
data. You cannot unshare a secret. Remove the URL and the headers before a config leaves
your phone, or rotate the secret afterwards.
In the same **Automations** tab, press **New Automation** and set **Automation Type** to
**REST API** again. Copy every setting from step 3 — the same address, the same header, and
the whole block. Then change the four that differ:
```json theme={"system"}
{
"exportDataType": "workouts",
"includeHealthMetrics": false,
"includeWorkouts": true,
"requestTimeout": 60
}
```
On screen that is three moves: open **Data Type** and choose workouts, turn health metrics
off in the include list, and turn workouts on. Then set **Timeout Interval** to 60.
`includeWorkoutMetadata` and `includeRoutes` stay `true` in both automations. They do
nothing in the metrics one, which carries no workouts.
You now have two automations, both on **Automation Type** **REST API** and both on the same
address: one exports health metrics, one exports workouts. Health Auto Export exports one
data type per automation. With one automation, workouts never arrive.
Sleep rides the metrics automation, not this one. Health Auto Export exports sleep as
the metric `sleep_analysis`, and Postern turns that metric into sleep sessions.
Postern stores workout routes and workout metadata in `raw` only. They are not columns
an agent can query, and they make each push larger. Leave them on anyway: the phone in
production has run `includeRoutes` and `includeWorkoutMetadata` on for weeks, one day per
push, and no push has been refused on size.
Set each automation's schedule. Hourly is a good default; the phone in production pushes
every hour. Then run one automation by hand in the **Automations** tab, rather than wait
for the schedule.
In the Console, open **Sources** → **Apple Health**. Until the first push lands the
connection carries the badge **Awaiting first push**. When it lands, that badge
disappears, the line reads **Last synced** with a time, and the caption beneath reads
**Device controlled**. A healthy connection carries no badge, and no next time is
predicted.
Postern stamps **Last synced** on every push that arrives, even a push that stored no
records.
You can run the automation again safely. Health Auto Export's export windows overlap on
purpose. Postern gives every sample, sleep session and workout a fixed id. The same
data sent twice updates those rows. It never duplicates them.
Keep the gap between pushes under 48 hours. After 48 hours without a push the connection
reads **Stale**. **Stale** is advice, not a fault. Your phone sends data to Postern when it
decides to. Postern cannot ask for it, so there is no **Sync now** button, and Postern
never calls a device **Unreachable**.
Nothing arrives, and nothing on the machine Postern runs on explains why. Every
rejection at the ingest endpoint answers with the same `401` and the same body,
`{"error":"unauthorized"}`. The answer never says which cause it was, so check all
four:
1. The address carries the connection id the Console printed.
2. The header holds the secret exactly.
3. The connection is not paused. **Pause receiving** stops new pushes. Data already
stored still answers.
4. The phone can reach the machine Postern runs on.
[Every failure answers identically on purpose](/reference/ports#the-push-ingest-route).
A request that never arrives leaves no trace. From the phone, a network problem and a
wrong secret look the same. The two `curl` checks in
[Open two ports to your own devices](/start/remote-access#your-devices) separate them.
## Confirm it works
* **Console → Sources**: one Apple Health connection, not two.
* The connection page: **Samples cached** reads above zero.
* The connection's **Delivery** panel: **Shared secret** reads `•••••••••••• set` and a relative
time — `•••••••••••• set 3 days ago`, or `just now` on a secret you made this minute. It is not a
calendar date. It must not read `no secret minted yet`, and the button beside it must read
**Rotate secret**, not **Mint secret**.
* **Health Auto Export → Automations**: two automations, both on **Automation Type**
**REST API** and both on the same address. One exports health metrics, one exports
workouts.
## If something went wrong
| What you see | What to do |
| ------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `{"error":"unauthorized"}`, or nothing arrives at all | Check all four causes; they answer identically. The address carries the connection id the Console printed; the header holds the secret exactly; the connection is not paused (**Resume receiving** on its **State** row); the phone reaches port 8443. |
| The connection reads **Last synced**, but **Samples cached** stays at 0 | The push arrived and stored nothing. Check the export version reads v2 in both automations, then run one by hand. |
| `{"error":"payload too large"}` | The push passed 25 MB, and none of it landed. Set the export file length back to one day (`exportFileLength: "day"`) and turn batch requests off (`batchRequests: false`) in both automations. Postern records nothing for a push it refuses on size — not even in the record. The app's own answer on the phone is the only place you will see this. |
| You did not copy the secret, or you shared an exported automation that held it | Open the connection → **Delivery** → **Rotate secret**. Every device on the old secret stops. Paste the new secret into both automations. |
## What you have now
Your phone sends health data straight to Postern, with no cloud in between. Postern
refuses a push that does not carry the correct secret.
An agent can read what your phone has sent since you set this up: sleep, workouts and
every metric you selected. Two of those arrive renamed or thinned by the settings this
page prescribes — [what `aggregateData` and `aggregateSleep`
cost](#metrics-automation). There is no history to backfill. Health is read-only here —
a key granted **health** reads this data, and there is nothing to act on.
Your phone decides when data moves. If the data looks old, run the automation on your
phone. The secret lives in those two automations until you rotate it. Rotate it and
every device on the old secret stops. **Pause receiving** stops new pushes; data already
stored still answers. A paused connection refuses a push exactly as a wrong secret does.
## Next
your own Google Cloud app + one app password · about 20 minutes · weekly re-consent until you
publish to production
a key you created, granted health · a few minutes, plus a restart of the agent · one config
block to paste
# Connect ChatGPT
Source: https://docs.getpostern.com/connect/chatgpt
ChatGPT connects from OpenAI's cloud, so Postern needs a public HTTPS address on port 443 before you start.
**Before you start**
* **A paid ChatGPT plan that offers Developer mode.** It is what lets ChatGPT call a server of your
own. Step 3 turns it on.
* **A public HTTPS address on port 443, already set up.** ChatGPT connects from OpenAI's cloud on
port 443 only. It cannot reach `localhost` or your private Tailscale network. Nothing on the
internet can reach Postern until you set this up, and it is off by default: [Set up remote
access](/start/remote-access) — Tailscale plus Funnel, about 20 minutes, once.
* **Postern running, and the Console at [http://localhost:8787](http://localhost:8787).**
Everything on this side happens at **Agents & keys**.
* **Your password manager open.** Postern shows the key once. ChatGPT asks for it at the **end** of
the sign-in, in another window, after step 2 has replaced it on your clipboard.
About 10 minutes, once the address is up. Every ChatGPT label below comes from a real run on
1 August 2026. Where that run recorded no label, this page names none. OpenAI renames these screens,
so trust your screen over this page.
If you already saved an agent key that expires, start at [step 2](#copy-the-endpoint).
Open the Console at [http://localhost:8787](http://localhost:8787). Go to **Agents & keys** and press
**Mint a key**.
In **Name**, type `chatgpt`. That name is what the record prints under **Who**.
Under **Grant which sectors**, tick each sector ChatGPT may reach. The six toggles read **Finance**,
**Mail**, **Calendar**, **Contacts**, **Health** and **Home**. A grant covers read and act across
every provider in the sector, and only **Home** has anything to act on today —
[what a grant covers](/reference/grants-and-sectors#what-a-grant-covers). A key with no sectors
ticked still connects, and Postern then denies every read.
Under **Expires**, press **30 days**, **60 days** or **90 days**. Do not press **Never**: the
sign-in in step 5 refuses a key that never expires. Once you save an address, the form starts on
**90 days** and prints `This gate is published. A key you paste into a hosted client should expire.`
Postern cannot show you this key again. It keeps a scrambled copy it can check against, never the
key itself. The only remedy is a new key. Step 2 then puts your address on the clipboard, over the
key, and ChatGPT does not ask for the key until step 5.
Press **Mint the key**. A screen opens headed `chatgpt is ready`, with the key under
**Agent key — shown once**. Press the **Copy** beside it, then paste and save it in your password
manager.
On that same screen, follow **Connect a hosted client (claude.ai, ChatGPT) →**. From anywhere else:
**Agents & keys** → **Set up the bridge →**. Both open **Connect claude.ai or ChatGPT**.
If your address works for ChatGPT, that page prints it under **Paste this into claude.ai or
ChatGPT**. Press **Copy** there. It ends in `/mcp`, which the Console adds itself —
[the endpoint](/reference/mcp-primitives#the-endpoint):
```text theme={"system"}
https://gateway.example-tailnet.ts.net/mcp
```
The **MCP endpoint** block on the previous screen prints the address on the machine Postern runs
on, which ChatGPT can never reach. It still reads that way after you save a public address. Copy
only from **Paste this into claude.ai or ChatGPT**.
No **Copy** button, and the pattern `https://your-mac.tailnet.ts.net/mcp` in place of your address?
One sentence on that page says which of five things is true.
| What the page says | What to do |
| ------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------- |
| `Bridge is off — agents can only reach this gate with a pasted key` | Nothing was ever published. [Set up remote access](/start/remote-access). |
| `Bridge is off — an address is saved but not published yet` | In the folder that holds `docker-compose.yml`, run `docker compose restart app`. |
| `Bridge is off — this gateway couldn't read its own exposure setting` | Open Settings → **Remote access**, which says why. |
| `This gateway didn’t answer with its bridge status` | About the Console's own request, not about Postern. Reload. |
| `Hosted clients egress on port 443 only; on any other port the connection is reset with nothing you'll see.` | Your address is local, plain `http`, or off port 443. Fix it in Settings → **Remote access**. |
Open ChatGPT's settings, then **Plugins**. Scroll to the bottom of that list, past **Browse
plugins**, and press **Developer mode**.
ChatGPT moves you to **Security and login**, and the address ends
`#settings/Security?section=developer-mode`. The **Developer mode** row there carries a red
**⊘ ELEVATED RISK** badge and the line *Allows you to add unverified connectors that could modify
or erase data permanently. Use at your own risk.*
That badge is correct. Developer mode is what lets ChatGPT call a server you point it at, rather
than one OpenAI reviewed. Turn **Developer mode** on.
No menu in ChatGPT says **Connectors**. The settings rail says **Plugins**, ChatGPT's banner says
**Apps**, and the addresses still say Connectors. Three names, one thing. Go by the rail.
The run behind this page met that screen with **Developer mode** already on. Nobody wrote down
the switch's own name, or what it reads afterwards. Go by the row's name.
Open `chatgpt.com/plugins`. The page carries the heading *Plugins — Work with ChatGPT across your
favorite tools.* Press the **+** button, top right. The **New Plugin** form opens.
* **Name** — type `Postern`. Its placeholder reads `Custom Tool`.
* **Connection** — leave the toggle on **Server URL**, not **Tunnel**, and paste the address you
copied in step 2. Its placeholder reads `https://example.com/sse`.
* **Authentication** — already reads `OAuth`. Leave it.
* **Icon** and **Description** are optional. Skip both.
Watch **Advanced OAuth settings** as you paste. It starts at *Enter a valid MCP Server URL to review
discovered OAuth settings*. Once your address goes in, it changes to *Review discovered OAuth
settings, or enter them manually, then choose a client setup method and configure default scopes*.
That change means ChatGPT reached your Postern.
Under the red *⚠ Custom MCP servers introduce risk* warning, tick **I understand and want to
continue**. **Create** stays greyed out until you do. Press **Create**.
The button shows a spinner. ChatGPT then lands on **App Preferences**, where **Permissions** reads
`Allow low-risk`. That setting decides when ChatGPT asks you before it uses a plugin, not what
Postern allows. The run behind this page changed nothing there. The address still says `Connectors`,
as it does everywhere in ChatGPT's settings.
A second tab opens on your own address, served by your own Postern. Step 5 happens in that tab.
If no tab opens, your browser blocked it. Allow pop-ups for `chatgpt.com`, then press **Create**
again. You can also close that tab before you approve: press **Create** again to reopen it.
If ChatGPT says instead that it could not reach your server, and nothing appears in your logs:
nothing arrived, so there was nothing to log. Fix the address in step 2, then wait five minutes
before you retry. The Console says the same thing under the address:
`If claude.ai or ChatGPT says it can't connect, fix the address, wait five minutes, and try once: a
hosted client remembers a failed check for a few minutes.`
Your own Postern serves this tab. It opens blank, then resolves to your own address. It is plain
and unstyled, in a system font on a white background — nothing like the Console. That is normal.
It carries the heading **Authorize agent access**, then two lines. The first is the name ChatGPT
registered with your Postern, followed by `is asking to connect to your gateway.` The second reads
`Approving sends a sign-in code to`, then the address that code goes to, then `. If you did not
start this from that app, close this page.` Postern prints both from what ChatGPT registered.
Read both lines before you approve. Anyone who can reach your address can ask to connect, so those
two lines are your only check —
[why the bridge cannot refuse an unknown client](/reference/oauth-bridge#anyone-can-register-a-client). If the name
is not the app you started this from, or the address does not belong to OpenAI, close the page.
Paste the key from step 1 into **Paste an agent key from the Console**, then press **Approve**.
The tab goes black with a spinner and returns to ChatGPT. Postern shows no page of its own to say it
worked. ChatGPT confirms instead, with a green message over your plugin's own page. That page lists
no actions yet. That is what a new plugin shows, not a broken connection.
Your browser's password manager pops over the key field. Dismiss it. It can cover the **Approve**
button underneath, and the key is not a login.
The page answers `This agent key never expires. Keys used with a cloud client must have an expiry —
mint or rotate a key with a 30/90/365-day expiry in the Console, then try again.` The key is good;
its lifetime is not. Ignore the 365: the Console offers **Never**, **30 days**, **60 days** and
**90 days**, and nothing else.
Rotate it. Console → **Agents & keys** → `chatgpt` → **Rotate**. The form opens headed
`Rotate chatgpt`. Press **90 days**, then **Rotate the key**, then **Copy**. Save the new key and
run this step again with it. A rotation keeps the name and the sectors, so you do not tick the
sectors again.
In a chat, attach the plugin you named `Postern`. A `[P] Postern` chip lands in the message field.
Type your question after it.
ChatGPT shows plain-English progress, never tool names: **Describing the Current Context** means
ChatGPT called `describe_context`. On the `Allow low-risk` setting from step 4 it asked no
permission per call. A **Postern** entry in the **Sources** rail is the sign that a call landed.
ChatGPT can narrate work it never did. On the 1 August 2026 run it printed a progress line about a
weekly total, then `Worked for 50s`, then: *Postern didn't provide any transaction data in this
chat, so I can't calculate the total without guessing.* No call for it reached the record. When an
answer looks empty, open Console → **The ledger** before you change anything.
That failure also offers the wrong fix: its link points at `chatgpt.com/apps`, the public
directory, where a plugin you made yourself never appears. Yours is on the plugins page, under
**Personal → Created by me**.
## Confirm it works
* `chatgpt.com/plugins` lists **Postern** under **Personal → Created by me**.
* Console → **The ledger** holds a row with `chatgpt` under **Who**.
* That row names the tool ChatGPT called under **Tool**.
* Leave the sector filter alone. The Console says why: `One sector at a time also leaves out every
call that belonged to no sector — an agent asking what the gate holds, or a handshake the gate
refused. Those are still recorded; they just cannot match a sector.`
* An empty answer **with** a row means Postern has no sources yet. No row means nothing arrived.
## If something went wrong
| What you see | What to do |
| --------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
| `That agent key was not accepted. Check the key in the Console and try again.` | You pasted the address, not the key. Paste the key from your password manager into **Paste an agent key from the Console**. |
| `This agent key never expires. Keys used with a cloud client must have an expiry` | Console → **Agents & keys** → `chatgpt` → **Rotate** → **90 days** → **Rotate the key** → **Copy**. Approve again with the new key. |
| ChatGPT could not reach your server, and your logs show nothing | The request never arrived. Fix the address in Settings → **Remote access**, wait five minutes, try once. |
| Nothing answers at `http://localhost:8787`, and Postern runs on another machine | Open the Console over SSH first: [Set up remote access](/start/remote-access). |
## What you have now
ChatGPT holds a temporary pass issued by your own machine, never the key itself. It sees exactly the
sectors you ticked in step 1, and appears in the record under the name you gave it. Its access ends
when the key expires —
[the OAuth bridge, for hosted agents](/reference/oauth-bridge).
Revoke the key and Postern refuses ChatGPT's next call. Rotate it and its passes die at the same
moment — [revoking and rotating a key](/reference/agent-keys#revoking-rotating-and-removing).
Three standing costs come with this.
* The key now lives on OpenAI's infrastructure and dies on the date you chose. Postern then refuses
ChatGPT's calls, and to replace the key you work this page again from step 1.
* Your address stays reachable from the internet until you turn it off in Settings → **Remote
access**. That is also what turns the sign-in off: `Stop publishing and the sign-in disappears —
nothing else about this gate changes.`
* ChatGPT asked no permission per call on the run behind this page, so the sectors you ticked are
its whole boundary for as long as the key lives.
Any wait you feel comes from ChatGPT, not Postern. Postern answers reads from its cache, on your
own machine.
## Next
ChatGPT can only answer from sources Postern already holds. Pick the one you can finish now.
your own Google Cloud app and one app password · about 20 minutes · weekly re-consent until you
publish to production
Health Auto Export on your iPhone · about 10 minutes · push, not pull
# Connect Google and Gmail
Source: https://docs.getpostern.com/connect/google
Gmail with an app password. Calendar and contacts with your own Google Cloud app. The two parts are independent — do either one, or both.
**Before you start**
* **About 20 minutes.** 5 minutes for Gmail, 15 for calendar and contacts.
* **The Google account you want Postern to read.** Sign in to that one account first. Both secrets
below must belong to it.
* **Your password manager, open.** Google shows two secrets once each, in dialogs you can close by
accident.
* **Postern is running, and `http://localhost:8787` answers in the browser in front of you.**
Google sends the sign-in back to that address. If Postern runs on another machine, [set up
remote access](/start/remote-access#ssh-tunnel) first.
## Choose your path
Gmail uses an app password. Calendar and contacts use a Google Cloud app you register yourself.
Postern never asks Google for access to your mail, and the Cloud app you build below requests no
Gmail permission. [Why Gmail uses a password instead of a Google
sign-in](/reference/provider-sign-ins#what-each-provider-needs-and-why)
Part A is the first 2 steps below. Part B is the 8 steps after them.
| If you want… | Then |
| -------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
| mail | [Part A](#two-step-verification) — 2-Step Verification, then one app password. About 5 minutes. |
| calendar and contacts | [Part B](#create-project) — one Google Cloud project, one OAuth client, one sign-in. About 15 minutes. |
| all three | [Part A](#two-step-verification), then [Part B](#create-project). Neither part depends on the other. |
| a Google Workspace account | Choose **External** in [Part B](#consent-screen). **Internal** appears only on Workspace accounts, and this page does not cover it. |
Go to [myaccount.google.com](https://myaccount.google.com). Open **Security and sign-in** in the left
column. Under **How you sign in to Google**, find the **2-Step Verification** row and turn it on.
Google asks for your password, then a phone number, then a code it sends to that phone. Keep your
phone with you.
Google offers app passwords only to accounts with 2-Step Verification on. While that row reads
`2-Step Verification is off`, the page in the next step does not exist, and the words **App
passwords** appear nowhere in your Google Account. This changes your Google account, not Postern.
Open this address directly. The **Security and sign-in** page does not link to it.
```text theme={"system"}
myaccount.google.com/apppasswords
```
The page heading reads **App passwords**. In the **App name** field, type `Postern`, then create it.
Google opens a dialog headed **Generated app password**, under the line **Your app password for
your device**. The password is 16 characters. The Console's own **App password** field shows the
shape it expects: `xxxx xxxx xxxx xxxx`.
Google shows those 16 characters once. Copy them before you press **Done** — nothing can show them
again. If the dialog closes first, delete that entry on the **App passwords** page and create
another. Nothing else changes.
Google's own note under the password, headed **How to use it**, carries the reason: "…this app
password grants complete access to your Google Account." Keep it in your password manager.
Copy the 16 characters, then press **Done**.
In the Console, open **Sources** → **Add a source** → **Gmail**, or go straight to
`http://localhost:8787/connect/gmail`. Type your full Gmail address into **Gmail address**, and the
16 characters into **App password**. Spaces do not matter. Press **Connect Gmail**.
The Gmail screen then reads that Gmail is connected, and the button changes to **Reconnect Gmail**.
The connection appears under **Sources** as **mail**. Open it and press **Sync now** to force a
first read. The connection reads **Awaiting first sync** until that lands, then **Last synced** and
a time.
If the Console answers `A Gmail app password is 16 characters — check you copied all of it (spaces
are fine, they’re ignored).`, part of the password did not come across. Copy it again from the
dialog, or create a new app password.
Everything in Part B happens inside one Google Cloud project. Stay in it for every step below.
Go to [console.cloud.google.com](https://console.cloud.google.com) and sign in as the account that
will own the app. Open the project picker at the top of the page. Until you are inside a project it
reads **Select a project**. Press **Create project**.
The page heading reads **New Project**. **Project name** arrives prefilled with `My Project` and a
number — replace it with a name you will recognise. Under the field Google prints `Project ID:` with
an identifier it generated, then `It cannot be changed later.` Leave **Parent resource** at
`No organisation`. Press **Create**.
Then reopen the picker and select the new project. Google does not always switch you into it. Once
it has, the picker carries the project name on every page in this part.
On an account's first visit to the Cloud console, Google opens a dialog headed `Welcome, !`,
with your own account name in place of ``. It holds a **Country** list and a **Terms of
Service** checkbox that reads `I agree to the Google Cloud Platform Terms of Service, and the terms
of service of any applicable services and APIs.` Tick that checkbox and press **Agree and
continue**.
A banner then sits across the top of every page. On an account that has never tried the paid tier
it reads `Start your free trial with $300 in credit.` and carries **Learn more**, **Dismiss** and
**Start free**. On an account whose trial has ended it reads `Your free trial is over but you can
still access 20+ always-free products with a full account.` and carries **Learn more** and
**Activate**. Postern needs neither. Ignore the banner, or press **Dismiss** where it offers one.
A search for `contacts` shows the old **Contacts API** first, and it does nothing for Postern.
Contacts come through the **People API**. The old one names itself: its **Additional details**
block reads `Service name: contacts.googleapis.com` and `Last product update: 21/07/2022`, and its
overview says "This API is no longer being developed further. Please consider migrating to the
People API instead." If you land there, go back and open the **People API** card instead.
In that project, open **APIs and services** → **Library** in the left column. The breadcrumb reads
`APIs and services / API library / Browse`, and the page heading reads **API Library**.
Search for `calendar`. Google returns 4 cards: **Google Calendar API**, **Calendar MCP API**,
**CalDAV API** and **Workspace MCP API**. Click **Google Calendar API**, the one by
*Google Enterprise API*. A search result is a card, not a button.
The card opens a page headed **Product details**, with the tabs **Overview**, **Documentation**,
**Support** and **Related products**. Its **Additional details** block reads
`Service name: calendar-json.googleapis.com`. That is the right one, even though it does not read
`calendar.googleapis.com`.
Enable the API from that page. The heading then reads **API/Service details**, `Status` reads
**Enabled**, and **Disable API** sits at the top.
Do the same for `People API`.
Wait a minute or two after the second one before you connect from the Console.
Postern's Console writes this route as **APIs & Services** → **Library**. Google's own screen
writes **APIs and services**, with no ampersand. Two spellings, one place.
The consent screen has to exist before Google will create an OAuth client. The shortest route to it
is the page that refuses you.
In the same project, open **Google Auth Platform** → **Clients** → **Create client**. Google stops
you on a bar that reads **To create an OAuth client ID, you must first configure your consent
screen**. Press **Configure consent screen** on that bar.
The page heading reads **Project configuration**. It carries four numbered steps — **App
Information**, **Audience**, **Contact Information** and **Finish** — with **Create** and **Cancel**
at the bottom throughout. Google's older name for all this is the OAuth consent screen, and
Postern's Console still uses that name.
**1 · App Information.** Type a name into **App name**, which Google marks required. Its note reads
"The name of the app asking for consent". Google prints that name on every screen you meet from here
on, including its refusals. Name it `Postern`. Then pick your own address in **User support email**,
also required, whose note reads "For users to contact you with questions about their consent." Press
**Next**.
**2 · Audience.** Two options, each with its own description:
| option | Google's own description of it |
| ------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **External** | "Available to any test user with a Google Account. Your app will start in testing mode and will only be available to users that you add to the list of test users. Once your app is ready to push to production, you may need to verify your app." |
| **Internal** | "Only available to users within your organisation. You will not need to submit your app for verification." |
Choose **External**. Press **Next**.
On a personal Google account **Internal** cannot be chosen, and one note is the only thing that
says why. Hover **Internal** and it reads: "Because you're not a Google Workspace user, you can
only make your app available to external (general audience) users."
**Audience** is also required, and Google prints no message when you skip it. Press **Next** with
neither option chosen, and the blue `2` beside **Audience** turns into a red error mark. That mark
is the whole warning.
**3 · Contact Information.** Type your own address into **Email addresses**, which Google marks
required. Its note reads "These email addresses are for Google to notify you about any changes to
your project." Press **Next**.
**4 · Finish.** Press **Create**.
A message reads `OAuth configuration created.`, and you land on a page headed **OAuth overview**.
Under **Metrics** it reads "You haven't configured any OAuth clients for this project yet." with a
**Create OAuth client** button. That is correct. The client comes two steps from here, and there is
one thing to do first.
The same bar appears on **APIs and services** → **Credentials**, worded differently: **Remember to
configure the OAuth consent screen with information about your application.** Its
**Configure consent screen** button opens the same wizard.
Skip this step and Google refuses your own sign-in. While **Publishing status** is **Testing**,
only the accounts listed here may sign in — and a new app lists nobody, not even the account that
created it. The step costs 10 seconds, and nothing after this page works without it.
In the same project, open **Google Auth Platform** → **Audience**. Four sections sit on that page:
| section | what it reads on a new app |
| --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Publishing status** | **Testing**, with a **Publish app** button |
| **User type** | **External**, with a **Make internal** button, greyed out on a personal account |
| **OAuth user cap** | "While publishing status is set to 'Testing,' only test users are able to access the app. Allowed user cap prior to app verification is 100, and is counted over the entire lifetime of the app." |
| **Test users** | a **+ Add users** button |
Under **Test users**, press **+ Add users**. Add the Google address you will sign in as, and save it.
**Test users** then lists that address, and the **OAuth user cap** meter reads
`1 user (1 test, 0 other) / 100 user cap`.
Google matches the redirect address character for character. Copy it from your own Console — do not
type it, and do not copy it from this page. Postern builds that address from its own port, so the
Console holds the only copy that stays true. [Why Postern pins the address, and never reads it off
your browser](/reference/provider-sign-ins#the-redirect-address-is-pinned-inside-postern)
Open the Console's Google screen in another tab: `http://localhost:8787/connect/google`. Its left
column lists four numbered steps. The third reads *Create an OAuth client, type Web application —
add this redirect URI, pasted exactly:*. Under it sits the address, with a **Copy** button beside it.
Press **Copy**. The button then reads **Copied**. On a stock install the address reads:
```text theme={"system"}
http://localhost:8787/api/oauth/google/callback
```
Back in the Cloud console, open **Google Auth Platform** → **Clients** → **Create client**. The page
heading reads **Create OAuth client ID**.
Choose **Web application** in **Application type**, which Google marks required.
Type a name into **Name**, also required. It arrives prefilled with `Web client 1`. Google's note
reads "The name of your OAuth 2.0 client. This name is only used to identify the client in the
console and will not be shown to end users."
Under **Authorised redirect URIs** — the section whose note reads "For use with requests from a web
server" — press **+ Add URI**. A field appears, labelled **URIs 1** and marked required, which shows
`https://www.example.com` until you type. Paste the address you copied.
Do not use **Authorised JavaScript origins** above it, whose note reads "For use with requests from a
browser".
Both section labels change spelling with the account's language. These captures read `Authorised`;
other accounts read `Authorized`, with a z. Match a section by its note, not by its spelling.
Google shows the client secret once, in the dialog it opens the moment you press **Create**. Its
own wording: "You will no longer be able to view or download the client secret once you close this
dialogue. Make sure that you have copied or downloaded the information below and stored it
securely." Copy the client ID and the client secret before you close it. The client ID stays
readable afterwards; the secret never does. The only way back is to delete the client and create
another, which changes the client ID too.
Press **Create**. Google opens a dialog headed **OAuth client created**. It holds **Client ID**,
**Client secret**, **Creation date**, `Status` **Enabled** and a **Download JSON** control. Each of
the two values has a copy control beside it. Copy both now, then press **OK**.
Two lines in that dialog matter. One reads "The client ID can always be accessed from the Clients tab
under the Google Auth Platform." The other repeats the last step's rule: "OAuth access is restricted
to the test users listed on your OAuth consent screen".
Google's own note at the foot of the form reads "Note: It may take five minutes to a few hours for
settings to take effect".
Google's **APIs and services** → **Credentials** page lists the same clients, under **OAuth 2.0
Client IDs**. Either route reaches them.
Go back to the Console's Google screen (`http://localhost:8787/connect/google`). Under **Configure
the app**, paste the client ID into **Client ID**, and the client secret into **Client secret**.
Google needs both halves. With only the ID, the Console answers `Google is a confidential client —
paste the client secret too, or the sign-in will be refused.`
Sign in as the address you added under **Test users**. Google refuses every other account,
whichever one the browser is already signed into. Its refusal fills the page, and it names your
app:
`Access blocked: Postern has not completed the Google verification process`
`Postern has not completed the Google verification process. The app is currently being tested and
can only be accessed by developer-approved testers. If you think that you should have access,
contact the developer.`
`If you are a developer of Postern, see error details.` · `Error 403: access_denied`
Google prints whatever you typed into **App name**, so your own copy carries that name where this
one reads `Postern`. Nothing was saved. Add the address under
[**Test users**](#test-users), then start again from the Console's Google screen.
Press **Save & sign in with Google**. The button reads `Redirecting...`, and Google's account chooser
opens in the same tab. The Console hands that tab over, so finish anything else you have open in it
first.
If Google refuses, the Console puts you back on this Google screen with Google's own error code
beside the form. Fix it there — the steps and both fields are on that screen.
Two Google screens follow, and both read like failures.
The first says **Google hasn't verified this app**. That is what an app whose **Publishing status**
is **Testing** looks like to its own author. **Continue** is the plain text link at the bottom. The
blue **Back to safety** button cancels the sign-in.
The second screen carries two headings. On the left it reads **Postern wants access to your Google
Account**, with the address you signed in as below it. Over the permission list on the right it
reads **Select what Postern can access**.
Postern asks for two permissions, and both are read-only:
* **See and download your contacts.** — `contacts.readonly`
* **See and download any calendar that you can access using your Google Calendar.** — `calendar.readonly`
No Gmail permission appears, on this screen or anywhere else.
The checkboxes start empty, and Google lets you continue with none of them ticked. That sign-in
succeeds with no error and grants nothing. Postern saves the credential and creates no connection,
so the source looks half-connected and answers nothing.
Tick **Select all**, then press **Continue**. **Cancel** sits beside it and abandons the sign-in.
Google returns you to the Console's **Sources** screen. The one sign-in becomes two connections,
**calendar** and **contacts**. [Why one sign-in creates two connections and not
one](/reference/grants-and-sectors#which-sectors-a-sign-in-turns-on)
Open either connection and press **Sync now** to force a first read. Each then shows a **Last
synced** time.
Finish the sign-in in one go, within 10 minutes after you press **Save & sign in with Google**. If
you take longer, restart Postern, or reuse an old tab, Postern refuses the return trip and the
browser shows `{"error":"invalid or expired state"}`. Postern stored nothing. Start again from the
Console's Google screen; you lose nothing.
While **Publishing status** stays **Testing**, Google expires the app's access every 7 days. Calendar
and contacts then stop until you sign in again.
To end that, open **Google Auth Platform** → **Audience** — the same page where you
[added your test user](#test-users) — and press **Publish app** under **Publishing status**. Confirm
what Google asks for.
**Publishing status** then leaves **Testing**, and the 7-day expiry stops. Google's own documentation
calls the status you land on "In production". Nobody here has captured that screen, so match it by
what it is not: **Testing**.
For a one-person app that asks for these two read-only permissions, this is a form, not a review.
This step is optional. A weekly sign-in works, and a Google app left in **Testing** is not a broken
one.
## Confirm it works
* **Sources** lists three connections: **mail**, **calendar** and **contacts**.
* Each of the three shows a **Last synced** time.
* The Console's Gmail and Google screens read that the source is connected, and their buttons read
**Reconnect Gmail** and **Reconnect Google**.
* In the project that owns your client, **Google Calendar API** and **People API** both read `Status`
**Enabled**. Each page carries **Disable API** at the top.
* On **Google Auth Platform** → **Audience**, **User type** reads **External**, and **Test users**
lists the address you signed in as.
## If something went wrong
| What you see | What to do |
| --------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Access blocked: Postern has not completed the Google verification process`, with `Error 403: access_denied` under it | Your address is not listed as a test user, or you signed in as another account. Open **Google Auth Platform** → **Audience** → **+ Add users**, add it, save it, then sign in again from the Console. Google prints your own app name where this reads `Postern`. [Add yourself as a test user](#test-users) |
| `OAuth access is restricted to the test users listed on your OAuth consent screen.` | The same cause, worded differently by Google. Add your address under **Test users**, then sign in again from the Console. [Add yourself as a test user](#test-users) |
| **To create an OAuth client ID, you must first configure your consent screen** | The project has no consent screen yet. Press **Configure consent screen** on that bar. It opens the **Project configuration** wizard. [Set up the consent screen](#consent-screen) |
| **Remember to configure the OAuth consent screen with information about your application.** | The same cause, on the **Credentials** page. The **Configure consent screen** button beside it opens the same wizard. [Set up the consent screen](#consent-screen) |
| **Internal** is greyed out on the **Audience** step of the wizard | Hover **Internal**: "Because you're not a Google Workspace user, you can only make your app available to external (general audience) users." Choose **External**. Audience is required, and a skipped choice turns the step marker red with no message beside it. [Set up the consent screen](#consent-screen) |
| Contacts stay empty while calendar works | You enabled the old **Contacts API**, whose `Service name` reads `contacts.googleapis.com`. Enable the **People API** as well. [Enable the two APIs](#enable-apis) |
| A permission error on calendar or contacts right after a successful sign-in — the Console shows it as 403 | The two APIs are not enabled in the project that owns your client. Open that project's **APIs and services** → **Library**, enable **Google Calendar API** and **People API**, wait a minute or two, then press **Reconnect Google**. [Enable the two APIs](#enable-apis) |
| Google refuses before any consent screen appears, and names the redirect URI | The address under **Authorised redirect URIs** does not match. Press **Copy** on the Console's Google screen, and replace the address on the client. [Create the OAuth client](#oauth-client) |
| `{"error":"invalid or expired state"}` in the browser after you approve | The sign-in ran past 10 minutes, or Postern restarted, or you reused an old tab. Postern stored nothing. Start again from the Console's Google screen. [Paste both halves and sign in](#sign-in) |
| The Console reads that Google is connected, but no **calendar** or **contacts** connection appears under **Sources** | You approved with no permission ticked. Press **Reconnect Google**, tick **Select all**, then press **Continue**. [Tick every permission](#grant-scopes) |
| The sign-in finished at Google and the browser landed on nothing | `http://localhost:8787` did not answer in that browser, so Postern created no connection. Run the sign-in on the machine Postern runs on, or [set up remote access](/start/remote-access#ssh-tunnel) first, then start again from the Console's Google screen. |
## What you have now
Three connections: **mail** from Gmail, **calendar** and **contacts** from Google. Any agent you
grant mail, calendar or contacts reads from them.
For mail, Postern stores who sent it, the subject, the dates and the preview line. It never stores
the message text — it fetches that when an agent asks for it. Gmail comes in over IMAP, the standard
way mail apps read a mailbox, so your Gmail address is also the login.
Calendar and contacts are read-only. Postern cannot change anything in them. [Why the Google
connector can never act, whatever permission it holds](/reference/grants-and-sectors#which-sectors-an-agent-can-act-in)
What this costs you from here on:
* While **Publishing status** stays **Testing**, you sign in again every 7 days. [Publish the
app](#publish) ends that.
* Revoke the app password or the Google sign-in at your Google Account, not in Postern. Each stops
only its own connections, and a fresh sign-in overrides an earlier revocation.
* Connect a source again and Postern replaces the saved credential rather than adds a second one.
First it makes you tick a box — **Yes — replace the stored credential.** on Gmail, **Yes —
replace the stored app and re-run consent.** on Google.
* Postern encrypts the client secret and keeps it on your own machine. [Postern sends it only to
Google, only to ask for fresh access](/reference/provider-sign-ins#what-each-provider-needs-and-why)
## Next
an agent key, shown once · a few minutes, plus a restart of the agent · an agent that can reach
the machine Postern runs on
your own Entra app · about 15 minutes · public client — no secret
# Connect Home Assistant
Source: https://docs.getpostern.com/connect/home-assistant
Stream your Home Assistant devices into Postern. It is the only source an agent can act on.
**Before you start**
* **A Home Assistant that is up on your own network, and about 5 minutes.** Postern connects to it
directly. No cloud service, no account.
* **Postern installed, with the Console open.** Open `http://localhost:8787` in a browser on the
machine Postern runs on. If that machine has no screen,
[open the Console over SSH](/start/remote-access#ssh-tunnel).
* **Your password manager open.** Home Assistant shows the token once, in step 1, and nothing
re-reveals it.
* **A Home Assistant account you are willing to lend.** The token carries exactly what that user
can do, and Postern acts as that user. A sector is one area of your life: finance, mail,
calendar, contacts, health, home. An agent you grant `home` can run any device action here, with
no confirmation for each one.
In Home Assistant, click your own name at the very bottom of the left sidebar. It sits below
**Settings** and **Notifications**, with a small round picture beside it. Nothing reads “Profile”.
Your profile opens on the **General** tab. Click the other tab, **Security**. The address now ends
`/profile/security`.
Scroll to the bottom of that tab. The section headed **Long-lived access tokens** sits below
**Change password**, **Multi-factor authentication modules** and **Refresh tokens**.
Older Home Assistant versions show no tabs. There the same section sits at the bottom of the profile
page — [Managing account access](https://www.home-assistant.io/docs/authentication/#managing-account-access).
Home Assistant shows the token once, at the moment you create it. It keeps no copy of the token
string, so nothing re-reveals it and the only remedy is a new token. Open your password manager
before you create the token.
Press **Create token**, at the bottom right of that section. A dialog opens, headed **Create token**,
with one required field labelled **Name\***. Type `Postern` into it. That name is how you tell this
token apart from your others in Home Assistant.
The dialog carries **Cancel**, which creates nothing, and a second **Create token** button. That
button stays greyed out until the field has something in it.
Press the dialog's **Create token**. Home Assistant replaces the dialog with a screen headed
**Token created:** followed by the name you typed. It warns *"Copy your access token. It will not
be shown again."* The token sits in a read-only field, too long to read at that width.
Press **Copy**, to the right of the field. A message reads *"Copied to clipboard"*. Paste the token
into your password manager. You paste it into the Console in step 3, and again whenever you
reconnect.
A **Generate QR code** control sits below the token. Postern has no use for it.
Press **Close**. `Postern` appears at the top of the list, with its creation time beside it.
Open Home Assistant in a browser and read the address bar. You need that machine's numeric
address and its port, in the shape of the Console's own example:
```text theme={"system"}
http://192.168.1.50:8123
```
`8123` is Home Assistant's own default port. Keep whatever port your address bar shows.
If the address bar shows a name instead of numbers, open your router's settings page. Its list of
connected devices gives each one a numeric address.
Postern runs inside its own sandbox, a Docker container. From in there a `.local` name resolves to
nothing. `localhost` and `127.0.0.1` name the sandbox itself, not your Home Assistant — even when
both run on one machine. The Console accepts a wrong address of the right shape without
complaint, creates the connection, and the connection never starts. Use the numbers.
Recommended. Reserve that address for the Home Assistant machine on your router's settings page.
Routers call it a DHCP reservation, a static lease, or an address reservation. Otherwise the address
changes weeks later and this connection stops.
In the Console, go to **Sources** → **Add a source** → **Home Assistant**. The card has two fields.
Put the address from step 2 into **Instance URL**. It must start with `http://` or `https://`.
Without that the Console answers *"That isn’t a URL — your Home Assistant address starts with
http\:// or https\://, e.g. [http://192.168.1.50:8123](http://192.168.1.50:8123)."*
Put the token from step 1 into **Long-lived token**. An empty field answers *"Paste the long-lived
access token you copied from Home Assistant."*
Press **Connect Home Assistant**. A message reads *"Home Assistant connected."* The Console returns
to **Sources**. The new connection appears under **home** with the badge **Awaiting first push**.
That badge is normal. Home Assistant sends changes the moment they happen, and nothing has arrived
yet. There is no schedule to set. Postern rescans its connections every 60 seconds, so the
connection comes up within about a minute. No restart, nothing to press. The badge then disappears
and the connection reads **Instant — connected**.
**Unreachable**, with *"can't reach source — retrying"*: nothing answered at that address. Postern
tries again after 5 seconds, then doubles the wait after each failure, up to 60 seconds. A Home
Assistant that was not ready yet recovers by itself. A wrong address never does. **Error**, with
*"auth failed: invalid token"*: Home Assistant refused the token, and Postern will not retry a
refused token — [Home Assistant throttles repeated sign-in
failures](/reference/provider-sign-ins#a-refused-source-credential-is-not-retried). Neither state clears
on a timer; a changed address or token is what clears it.
To correct either value, paste it on this same card. The card reads *"Home Assistant is already
connected. Connecting again replaces the stored credential — it won't create a second copy."* Tick
**Yes — replace the stored credential.** and press **Reconnect Home Assistant**. The next scan
restarts the connection within a minute.
## Confirm it works
* Console → **Sources** → the **Home Assistant** row: under **Live stream**, the words **Stream
down** are absent.
* The line beneath reads *last event* with a time on it, not *no events yet*.
* **Entities cached** shows a number above 0.
* Change a light or a switch in Home Assistant. That *last event* time drops to seconds ago.
* Ask an agent granted `home` what it can control in your house. It answers with action ids such as
`home.light.turn_on` and `home.lock.lock`.
## If something went wrong
| What you see | What to do |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Unreachable**, `can't reach source — retrying` | Nothing answered there. Paste the numeric address with `http://` in front — never a `.local` name, `localhost` or `127.0.0.1` — and press **Reconnect Home Assistant**. |
| **Error**, `auth failed: invalid token` | [Create a new token in Home Assistant](#token), paste it on the same card, and press **Reconnect Home Assistant**. Take the same path if you lost the token before it reached the Console. |
| The connection sits at **Awaiting first push**; or an agent granted `home` lists no actions; or an action returns `home assistant: no live connection for this connection id — nothing was dispatched` | The live connection is not up, and Postern sent nothing to your house. Correct the address as in row 1 — the Console accepts a wrong address of the right shape. |
| An action returns `admin/system service not permitted (device/entity control only)` | Postern never runs admin or system services. There is nothing to change here. Run that one in Home Assistant yourself. |
## What you have now
The `home` sector, for reads and for actions. Any agent you grant `home` sees your devices' states,
reads the action list, and runs the actions you would run yourself: lights, scenes, switches,
scripts, automations and buttons. Postern works out which actions apply to which device, so the list
arrives instantly. [Home Assistant does not offer that mapping itself](/reference/mcp-actions#where-the-home-assistant-catalogue-comes-from).
Postern never runs an admin or system service. An agent that names one gets `admin/system service
not permitted (device/entity control only)` back — [the domains and services Postern
drops](/reference/mcp-actions#the-admin-and-system-services-postern-never-runs).
Postern grants permission per sector only. A granted sector covers reads and actions together, with
no narrower grant and no confirmation step — [what a grant
covers](/reference/grants-and-sectors#what-a-grant-covers).
Console → **The ledger** holds a row for every call, `invoke_action` among them, under that agent's
own name. Postern only ever adds to the record.
Postern sends each action once and never repeats it. A break mid-action returns `unknown — not
retried` — [Postern cannot know whether Home Assistant acted](/reference/mcp-actions#invoke_action). Check the
device yourself.
Postern stores the token encrypted on your own machine. It stays exactly as powerful as the Home
Assistant user who made it: if that account gains permissions, so does this connection.
To stop it at Home Assistant, go back to **Long-lived access tokens** on your profile's **Security**
tab. Every token's row ends in a trash-can icon, with no words on it. Press the one on the `Postern`
row. The connection then fails at its next check with `auth failed: invalid token`, and stays in
error until you paste a new one.
To stop it at Postern instead, go to Console → **Sources** → the **Home Assistant** row. Press
**Remove token**. A confirm step opens, headed **Remove the token**: *"Deletes the long-lived token
from the vault. Home stops immediately."* Type `Home Assistant` into the field labelled *"Type Home
Assistant to confirm"*, then press **Remove token** again. That second button stays greyed out
until the typed name matches exactly, and reads *"Working…"* while it runs. **Cancel** leaves the
connection as it is. On success the Console reads *"Revoked the Home Assistant credential."*
When the connection is down, an agent still reads device states from cache. The action list and
every action stop.
## Next
a key in hand and the Console open · a few minutes, plus a restart of the client you connect
your own Google Cloud app and one app password · about 20 minutes · weekly re-consent until you
publish to production
# Connect iCloud
Source: https://docs.getpostern.com/connect/icloud
One app-specific password from Apple gives Postern three read-only connections: mail, calendar and contacts.
**Before you start**
* **An Apple Account with two-factor authentication already on.** App-specific
passwords do not exist without it, and Postern cannot add one for you. If it is
off, turn it on first — [step 1](#app-password) says where.
* **About 5 minutes, and your password manager open.** Apple shows the password
once, on a screen with no copy button, and cannot show it again.
* **Postern installed, with the Console open** at `http://127.0.0.1:8787`. The
Console answers only on the machine Postern runs on. That machine must reach
the internet; behind a strict firewall, allow `*.icloud.com` and
`imap.mail.me.com:993` —
[the hosts iCloud needs](/reference/ports#what-postern-connects-out-to). If Postern runs on another
machine, open the Console from your own computer over SSH first:
[Open the Console over SSH](/start/remote-access#ssh-tunnel).
* **Three connections, or none.** One password creates mail, calendar and
contacts together. You cannot connect only one, and all three are read-only.
Sign in at
[account.apple.com/account/manage](https://account.apple.com/account/manage).
In the left rail, select **Sign-In & Security**. Under the **App-Specific
Passwords** card, select **View details**.
A window opens, titled **App-Specific Passwords**. A line under the title counts
the ones you already have. The heading **Passwords** sits over the list, one row
each: the name you gave that password, and the date you made it. The list holds
those two things only, never the password itself.
**No App-Specific Passwords card?** Two-factor authentication is off on the
account. App-specific passwords do not exist without it, and Postern cannot turn
it on for you. Turn it on first — on the web at
[account.apple.com](https://account.apple.com/), or in your Apple Account
settings on an iPhone, iPad or Mac. Apple's own help article calls the web
control *Upgrade Account Security*; nobody here has seen that screen, so look
for the wording your account shows. Come back here afterwards and the card is
there.
Open your password manager before you go on.
Press the **+** at the right-hand end of the **Passwords** heading.
The **Generate App-Specific Password** window opens. It holds one field. **Create**
below it is pale, and it does nothing while the field is empty.
Type `Postern` into the field. The field carries no label. Its placeholder,
**e.g. Bill Pay**, floats up into the corner as you type and becomes the label.
The name only helps you find this password later in Apple's list. **Create** turns
solid.
Press **Create**. The window dims and shows **Updating…**.
**Apple now stops you and asks for your Apple Account password. The flow has not
broken.**
A window headed **Confirm Your Password** takes over. Under the heading it reads
**For your security, enter the password for:** and then the address of your Apple
Account. One field, placeholder **Password**. Two buttons, **Cancel** and
**Continue**. **Continue** stays pale until the field has text.
Type your Apple Account password here, not an app-specific password, and press
**Continue**. This is Apple's screen on Apple's site. Postern never sees this
password.
The **Generate App-Specific Password** window comes back, your name still in it,
and shows **Updating…** again. Then Apple prints the password:
* The heading reads **Your app-specific password is:**
* Under it, the password itself: 4 groups of 4 lowercase letters, joined by
hyphens — `xxxx-xxxx-xxxx-xxxx`.
* Under that: **Enter this password into the password field of the app you would
like to sign in to. Password is case-sensitive.**
* One button, **Done**.
**There is no copy control on this screen.** No copy button, no copy icon, no
link. Select the password text yourself and copy it by hand, hyphens included.
Put it in your password manager now.
**Done** is the only control on the screen, and it is one-way. Apple cannot show
you this password again.
Press **Done**. You land back in the **App-Specific Passwords** window. The count
under the title has gone up by one. A new row at the foot of the list carries the
name you typed and today's date.
Postern never asks for your Apple ID password. Everything on this step happens on
Apple's own site, so anything Apple asks you here goes to Apple, not to Postern.
The Console's own steps still name `appleid.apple.com`. Both addresses open the
same account page today. Apple's own instructions name `account.apple.com`, so
this page does too.
In the Console at `http://127.0.0.1:8787`, go to **Sources** → **Add a source** →
**iCloud**. It is the first card under **Paste a token**.
Paste the app-specific password, never your Apple ID password. Postern stores
whatever you paste and does not check it, and Apple then refuses it —
[why Postern cannot tell the two passwords apart](/reference/provider-sign-ins#three-credentials-that-behave-like-passwords).
If you also plan to change your Apple ID password, change it **first**. An Apple
ID password change revokes every app-specific password on the account, at once
and without notice.
Fill the two boxes:
* **Apple ID** — your `@icloud.com` mail address, even when you sign in to Apple
with an address somewhere else. Mail accepts no other address. Calendar and
contacts accept either one.
* **App-specific password** — masked as you type.
Press **Connect iCloud**. The Console shows `iCloud connected.` and moves you to
Sources, where one iCloud group now holds three connections.
That message means Postern stored the password and created the three connections.
It does not mean Apple accepted it. This step never contacts Apple. The first sync
is the test.
Postern checks both boxes before it sends anything. An Apple ID that is not an
email address gets
`That doesn’t look like an Apple ID — it should be an email like you@icloud.com.`
An empty password box gets
`Paste the app-specific password you generated — four groups of four. Postern never sees your Apple ID password, only this one.`
Both are Postern's own refusals. Postern sent nothing. Correct it and press
**Connect iCloud** again.
In the Console, go to **Sources** → the iCloud group, and open the mail connection.
It starts at **Awaiting first sync**. The first sync starts within about a minute.
The label moves to **Syncing…** with a count that climbs, then to nothing at all.
A healthy connection shows no status word. **Stale**, **Unreachable**, **Error**,
**Paused** or **Disconnected** means a problem.
On a large mailbox the first pass runs for minutes. Reload the page and watch the
count under **Envelopes cached** climb.
**Sync now** waits 30 seconds for the run to finish, then reports
`Synced — 0 updated.` even when the run has not finished. On a first pass that means
the sync is still at work, not that the mailbox is empty.
| Connection | What it collects | Checked every |
| ---------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------- |
| Mail | Who sent it, the subject, the dates and the flags, from **INBOX** and **Sent** only. Postern never stores the message text — an agent that asks for one message pulls it from Apple on demand. Reaches back 180 days. | 10 minutes |
| Calendar | Every calendar on the account. Postern stores every date of an event that repeats as its own row, from 90 days back to about 400 days ahead. It does not store a date further out until that event next changes. | 15 minutes |
| Contacts | Every address book. | 15 minutes |
**Poll cadence**, on each connection's own page under **Controls**, sets how often
Postern checks. The floor is 5 minutes —
[why these intervals](/reference/mcp-freshness#what-the-cache-holds-by-source).
**Recency window** sets mail to 3, 6 or 12 months. It appears on the mail
connection's page only — the calendar and contacts pages do not have it. Change
it and Postern re-reads the whole window from the start, so **Envelopes cached**
falls before it climbs again.
All three connections turn to **Error**. Mail shows `icloud-mail: sync failed`.
Calendar and contacts show `apple: DAV connect failed` or
`apple: DAV account discovery failed`. These messages name the stage, not the cause — Postern
never logs what Apple said.
The cause is nearly always the password: either it was wrong from the start, or
Apple has revoked it. Three connections that stop on the same day after weeks of
normal syncs is an Apple ID password change and nothing else.
The Console disables **Sync now** while a connection sits in Error, with *Syncing
is held until the connection is restored* beside it. Repair it at Apple instead.
Make a new app-specific password —
[Create an app-specific password at Apple](#app-password). Go to **Sources** →
**Add a source** →
**iCloud**, tick **Yes — replace the stored app-specific password.**, and paste
it. All three connections go back to active. It never creates a second copy.
## Confirm it works
* Sources holds one iCloud group with three connections: mail, calendar and
contacts.
* None of the three shows a status word.
* Each shows a `Last synced` clock, a `Next poll` time, and a count under
`Envelopes cached`, `Events cached` or `Contacts cached`. A zero count with a
healthy clock is a real answer, not a failure — that connection has nothing
inside the window it covers.
## If something went wrong
| What you see | What to do |
| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| No **App-Specific Passwords** card under **Sign-In & Security** | Two-factor authentication is off on the account. Turn it on at `account.apple.com`, or in your Apple Account settings on an iPhone, iPad or Mac — [Create an app-specific password at Apple](#app-password). |
| **Confirm Your Password** appears after you press **Create** | Apple wants your Apple Account password, not an app-specific one. Type it and press **Continue**. The flow carries on where it stopped — [Create an app-specific password at Apple](#app-password). |
| No copy button on the screen that shows the password | Apple does not put one there. Select the password text yourself and copy it by hand, hyphens included — [Create an app-specific password at Apple](#app-password). |
| You closed Apple's screen before you copied the password | Apple cannot show it again. Make a second one and paste that. Take the lost one out of Apple's list with the **⊖** on its row — [Create an app-specific password at Apple](#app-password). |
| Mail stays empty while calendar and contacts fill up | The **Apple ID** box holds an address that is not `@icloud.com`. Mail accepts your `@icloud.com` address only. Paste again with that address — [Paste it into the Console](#paste). |
| `icloud-mail: sync failed`, `apple: DAV connect failed`, or `apple: DAV account discovery failed` | The password is wrong, or Apple revoked it. Make a new one, then re-paste it with **Yes — replace the stored app-specific password.** ticked — [Watch the first sync land](#first-sync). |
| `Synced — 0 updated.` on a mailbox that is not empty | The sync has not finished. Reload the connection's page and watch **Envelopes cached** climb — [Watch the first sync land](#first-sync). |
## What you have now
Three read-only connections behind one password: mail envelopes, calendar events
and contacts.
Any agent whose key carries mail, calendar or contacts can read them now, and can
pull the body of a single message on demand. None can write: all three connectors
ship with no actions at all, so no agent can send mail, change an event or edit a
contact. You choose what an agent can read when you create its key, not here —
[a grant is one agent's permission for one area of your life](/reference/grants-and-sectors#what-a-grant-covers).
You now carry one app-specific password at Apple. Apple allows up to 25 active
app-specific passwords. The **⊖** on a row takes that one password back. **Revoke
all**, below the list, takes back every one.
Take this one back and Postern stops: the three connections fail their next sync,
and nothing else on your Apple Account moves. An Apple ID password change does the
same, with no warning. A disconnect in the Console stops all three at once and
deletes the stored password. Either way, what Postern already cached stays as
read-only history until you remove it separately.
## Next
your own Google Cloud app + one app password · about 20 minutes · weekly
re-consent until you publish to production
a key you have already created · a few minutes, plus a restart of the client ·
paste one config block
# Connect Microsoft
Source: https://docs.getpostern.com/connect/microsoft
Register your own app at Microsoft, approve one consent, and get three read-only connections: Outlook mail, calendar and contacts.
**Before you start**
* **A Microsoft account** — personal, work or school. Postern reads the mail, calendar and
contacts of the account you sign in with.
* **Postern installed and started, with the Console open at `http://127.0.0.1:8787`.** The Console
opens only on the machine Postern runs on. If Postern runs on a NAS or another machine, open the
Console from your own computer over SSH first:
[Open the Console over SSH](/start/remote-access#ssh-tunnel).
* **About 15 minutes, in two browser tabs** — Entra in one, the Console in the other. You go back
and forth three times. One of those moves interrupts a half-filled Entra form, so leave that tab
open.
* **10 uninterrupted minutes for the last step.** Postern holds the sign-in open for 10 minutes
and cannot pause it.
At [entra.microsoft.com](https://entra.microsoft.com), sign in with the account whose mail, calendar
and contacts you want. You register your own app. Postern ships no shared one.
The portal's masthead reads **Microsoft Entra admin center**. In the left rail, open **Entra ID**,
then **App registrations**.
On the **App registrations** page, an account with no apps yet shows **There are no applications
here.** Press **+ New registration**. The registration form opens.
In **Name**, type `Postern`. Entra's helper under that box reads "The user-facing display name for
this application (this can be changed later)."
Do not submit the registration form yet. The next two steps fill in the rest of it.
**A dialog headed Register an application opens instead of the form.** It reads: "The ability to
create applications outside of a directory has been deprecated. You may get a new directory by
joining the M365 Developer Program or signing up for Azure." Its only button is **Cancel**, and
the same words sit in an amber bar across the page. Your Microsoft account has no directory yet.
Take **joining the M365 Developer Program** or **signing up for Azure**. Finish that sign-up. Then
come back and press **+ New registration** again. That is expected, not a wrong turn.
In the same form, find **Supported account types**. Entra prints "Choose the account types that can
use this application or access this API" beneath it.
Open the dropdown and choose this row:
```text theme={"system"}
Any Entra ID Tenant + Personal Microsoft accounts
```
The dropdown opens on **Single tenant only - Default Directory**. An app left on that row refuses a
personal Outlook or Hotmail sign-in.
[Why the default choice locks out personal accounts](/reference/provider-sign-ins#two-microsoft-registration-choices-postern-cannot-work-around)
Do not choose **Single-page application (SPA)**. Microsoft caps that platform's sign-in at 24
hours, so you would sign in again every day, and no Postern setting changes that. Choose
**Public client/native (mobile & desktop)**.
Lower in the same form, open **Select a platform** and choose **Public client/native (mobile &
desktop)**.
A redirect URI is the address Microsoft sends you back to after you approve. Microsoft matches it
exactly, character for character.
Leave the Entra tab open. In your second tab, open the Console at `http://127.0.0.1:8787`. Go to
**Sources** → **Add a source** → **Microsoft**, the first card under **Sign in with the provider**.
Press **Copy** beside the redirect URI. On a stock install it reads:
```text theme={"system"}
http://localhost:8787/api/oauth/microsoft/callback
```
The Console prints `localhost` rather than `127.0.0.1` on purpose. Microsoft's portal refuses an
address written as an IP number over `http`. Both addresses mean the same machine. If you moved the
Console's port, the Console prints the address that matches. Copy what the Console prints, never
what this page prints.
[Why the redirect URI must come from your own Console](/reference/provider-sign-ins#the-redirect-address-is-pinned-inside-postern)
Back in Entra, paste it into the field beside the platform. Never type it.
The platform now holds one redirect URI, which ends `/api/oauth/microsoft/callback`.
Submit the registration form. Entra registers the app and opens a page for it.
That page shows the app's client ID. Copy it. It is the only value you carry back to the Console.
It is 5 groups of letters and digits, separated by dashes. These zeros stand in for yours:
```text theme={"system"}
00000000-0000-0000-0000-000000000000
```
Change nothing else at Entra. Microsoft needs no client secret. Add no permissions by hand, and
switch on no API. The sign-in screen in the next step is where you grant the scopes.
[Why Microsoft needs no client secret](/reference/provider-sign-ins#what-each-provider-needs-and-why)
Back in the Console, go to **Sources** → **Add a source** → **Microsoft**.
Paste the client ID into the **Application (client) ID** field. Leave **Client secret** alone. The
Console disables that box, and it reads `not required — public client (PKCE)`.
Take the next click only when you have 10 uninterrupted minutes. Press **Save & sign in with
Microsoft**. Microsoft takes over the tab.
Microsoft then asks you to approve four permissions. Postern asks for `Mail.Read`,
`Calendars.Read`, `Contacts.Read` and `offline_access` — read your mail, read your calendars, read
your contacts, and keep the sign-in alive. Postern asks for nothing else, now or later.
Approve all four. Microsoft returns you to the Console's **Sources** page, which now holds three
Microsoft connections: mail, calendar and contacts.
**The browser shows `{"error":"invalid or expired state"}`.** The 10 minutes ran out, or you
already used this sign-in once. A Postern restart, or a reload of the callback address, also ends
it. Postern stored nothing. Start again from **Sources** → **Add a source** → **Microsoft**.
**The Console reads "Microsoft did not complete the sign-in.", with Microsoft's own code beneath
it.** Microsoft refused the sign-in, and Postern stored nothing. Read the code, correct the
registration at Entra, then press **Save & sign in with Microsoft** again.
On **Sources**, the three new rows read `Awaiting first sync`. That is normal. The sign-in creates
the connections; it starts no sync.
Postern picks up new connections within about 60 seconds. Each row then reads `Syncing…`, and then a
`Last synced` time. Until then, an agent that asks for mail gets an empty answer, not an error.
Postern caches the last 180 days of mail. That is the **6 months** setting. To change it, go to
**Sources** and open the Microsoft mail row. Under **Controls**, **Recency window** offers
**3 months**, **6 months** and **12 months**. Pick one. The control appears on mail connections
only, and Postern then re-reads the whole window from the start.
To replace the app registration, or to run the consent again, go to **Sources** → **Add a source** →
**Microsoft**. Tick **Yes — replace the stored app and re-run consent.** The button stays disabled
until you do. Press **Reconnect Microsoft**. It replaces the stored app and never creates a second
connection.
## Confirm it works
* In Entra, your app's platform reads **Public client/native (mobile & desktop)**, not
**Single-page application (SPA)**.
* The Console's **Application (client) ID** field holds the same value Entra shows on your app's own
page.
* **Sources** shows three Microsoft connections — mail, calendar and contacts — each with a
`Last synced` time.
* The Console's **Client secret** field is empty and reads `not required — public client (PKCE)`.
## If something went wrong
| What you see | What to do |
| --------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| A dialog headed **Register an application** blocks the form | Your Microsoft account has no directory yet. Join the M365 Developer Program or sign up for Azure, then register again — [Start a new app registration](#register). |
| Microsoft asks you to sign in again every day | Your app is on **Single-page application (SPA)**. In Entra, move it to **Public client/native (mobile & desktop)**, and add the redirect URI there — [Add the redirect URI under the desktop platform](#redirect-uri). |
| Microsoft refuses the sign-in for a personal Outlook or Hotmail address | Your app is on **Single tenant only - Default Directory**. Set **Supported account types** to **Any Entra ID Tenant + Personal Microsoft accounts** — [Choose the account type that covers personal accounts](#account-types). |
| Microsoft shows an error of its own, and the browser never returns to the Console | The registration does not hold the address Postern sends. In the Console, press **Copy** beside the redirect URI. Paste it into Entra over the old value — [Add the redirect URI under the desktop platform](#redirect-uri). |
| `{"error":"invalid or expired state"}` | The 10 minutes ran out, or you used the sign-in twice. Postern stored nothing. Start the sign-in again — [Paste the client ID and approve the sign-in](#console-consent). |
| The Console reads **Microsoft did not complete the sign-in.** | Microsoft refused the sign-in, and Postern stored nothing. Read Microsoft's code under that line, correct the registration, then sign in again — [Paste the client ID and approve the sign-in](#console-consent). |
| Fewer than three connections after a consent that looked successful | The consent granted fewer than four permissions. Press **Save & sign in with Microsoft** again and approve all four — [Paste the client ID and approve the sign-in](#console-consent). |
| The three rows still read `Awaiting first sync` | Postern picks up new connections within about 60 seconds. Reload **Sources** — [Wait for the first sync](#first-sync). |
## What you have now
Three read-only connections out of one consent.
| Connection | What Postern stores | How far back |
| ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------- |
| Mail | Inbox and Sent — who sent it, the subject, the preview line, the dates, and the read and attachment flags. Postern never stores the message text. An agent that asks for one message pulls the body from Microsoft on demand, and Postern stores it nowhere. | 180 days; **Recency window** sets 3, 6 or 12 months |
| Calendar | Your events | 365 days back, 365 days forward |
| Contacts | Your default contacts folder | all of it |
* **None of the three can write.** The connector carries no actions. No agent can send mail, change
an event, or add a contact through Postern.
* **Postern checks Microsoft every 5 minutes.** That is also the fastest it will go. **Poll cadence**
on a connection's page only offers slower settings.
* **The app registration stays yours at Entra.** Microsoft keeps the sign-in alive as long as
Postern uses it once every 90 days.
* **Postern never held a Microsoft password.** Revoke an agent, or disconnect Microsoft in the
Console, and neither one can touch a password you never pasted.
[What a grant covers](/reference/grants-and-sectors#what-a-grant-covers), and
[what you take back when you revoke one](/reference/agent-keys#what-a-revoke-does-not-touch)
## Next
Point a client at the MCP endpoint with a key you created. Local clients paste one config block;
claude.ai and ChatGPT need a public address first.
a WHOOP membership + a free dev app · about 10 minutes · confidential client
# Connect Plaid
Source: https://docs.getpostern.com/connect/plaid
One trip through Plaid's own window links one bank, and each bank becomes its own read-only connection. Plaid bills per bank, so use Plaid for the banks SimpleFIN cannot reach.
**Before you start**
* **A free Plaid developer account** at [dashboard.plaid.com](https://dashboard.plaid.com).
Postern includes no Plaid access of its own.
* **Money, per linked bank.** On Production, Plaid bills Transactions monthly for every bank you
keep linked. It bills Balance per request. Plaid publishes no price list. A new US or Canada
team lands on the free Trial plan instead. Trial gives real bank data, up to 10 linked banks,
and no security questionnaire.
* **Postern up, and the Console open.** Open `http://localhost:8787` in a browser on the machine
Postern runs on. Only this computer can reach these addresses. Nothing on your Wi-Fi, and
nothing on the internet, can. If that machine has no screen,
[set up remote access](/start/remote-access) first.
* **SimpleFIN first.** One SimpleFIN subscription covers every bank it reaches. Plaid bills per
bank. Use Plaid for the banks SimpleFIN cannot reach — [Connect SimpleFIN](/connect/simplefin).
* **Item and Link are Plaid's words.** An Item is one bank connection at Plaid. Link is Plaid's
connect-your-bank window.
This page documents Production, and Production is what the Console saves. The Plaid card says so
itself: `Console defaults to Production.` Plaid's Sandbox links a fake bank, not yours —
[it is for testing only](#sandbox-is-for-testing-only).
Every Plaid screen quoted below comes from one recorded run, on 29–30 July 2026. That run was on
Sandbox, so each Plaid screen in it carries a grey bar that reads
`You are currently in Sandbox mode.` Plaid's own screens are the same either way. Only your bank's
sign-in differs, and this page names no control on it. Trust your screen over this page.
## Choose your path
| If… | Then |
| ------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------- |
| You have not saved a Plaid app here yet | Start at [Create your Plaid developer account](#plaid-account). |
| Your app is saved and you want another bank | Open **Sources**, find the **Plaid** group, press **Add a bank**, then go to [Get past Plaid's phone screen](#link-the-bank). |
| A bank's **Cadence** cell reads `consent lapsed` | [Reconnect a bank when its consent lapses](#reconnect). |
Trial counts 10 banks for the lifetime of the team. A bank you remove does not give the slot back.
Plaid states it: *"Removing Items created on a Trial plan (using /item/remove) will not allow you
to create more Items."*
A bank you already linked at `my.plaid.com` does not carry over to Postern. Postern reads only
the banks you link through its own Plaid Link session. Linking such a bank again here spends
another Trial slot.
Open [dashboard.plaid.com](https://dashboard.plaid.com) and create an account.
Plaid's Trial plan covers US and Canada teams created on or after 2026-04-15. An older team uses
paid Production access instead. Which plan you hold decides what this page costs you.
The Console tells you where to go. Open **Sources**, press **Add a source**, then press **Plaid**.
The card's left column is headed **Register your app**, which the screen prints in capitals. It
carries 3 numbered lines:
1. `Sign in at dashboard.plaid.com → Team Settings → Keys.`
2. `Copy your client_id and the Production secret.`
3. `Request Production access if you haven’t — Plaid approves it.`
The card's first line is out of date. Plaid's dashboard has no Team Settings item. Follow this
page instead, and expect the card to be corrected.
In Plaid's dashboard, the left rail groups its items. Under **PLATFORM**, open **Developers** and
select **Keys**. The address is
[dashboard.plaid.com/developers/keys](https://dashboard.plaid.com/developers/keys), which you can
also open directly.
The page is headed **Keys** and carries 3 cards, one under the next:
| card | what it holds |
| --------------------- | ----------------------------------------------------------------------------------------- |
| **Client ID** | Readable on the page. One copy control beside it. |
| **Production secret** | Hidden behind dots. A control reveals it, a second copies it, and **Rotate** replaces it. |
| **Sandbox secret** | The same 3 controls, over a different value. |
Copy the **Client ID**. Then copy the **Production secret** — the second card, not the third.
Both secrets sit on this one page, a card apart, and they look identical once revealed. This is the
step where the wrong one gets copied. A Sandbox secret is not refused loudly: Postern saves it,
Plaid's production host rejects the call, and no bank ever links.
The Client ID is the same string in every Plaid environment. Each environment has its own secret.
Postern saves what you paste here as a Production app, and the card's own note says so:
`Console defaults to Production.`
Postern encrypts the secret and stores it on your own machine as you save. The Console never shows
it again: the field afterwards reads `already sealed — leave blank to keep`. Plaid's dashboard is
the only other place you can read it.
The card's right-hand panel is headed **Configure the app**, again in capitals on screen. It carries
**Client ID**, **Secret**, and the button that opens Plaid Link.
Paste the `client_id` into **Client ID**. Paste the Production secret into **Secret**.
Press **Save & add a bank**.
That button reads **Save & add a bank** until you save an app.
After you save one it reads **Add a bank**, and **Secret** reads
`already sealed — leave blank to keep`. Leave **Secret** blank to keep the stored secret.
Postern opens Plaid Link in a new browser tab. The Console panel switches to **Link your banks** and
reads `waiting for the first bank`.
If no new tab opened, a pop-up blocker stopped it. Press **Re-open Plaid Link** on the panel behind
it. It opens the same address.
That address works for 3 hours. After that, press **Add a bank** again.
The new tab carries the title `Connect with Plaid`. Its first screen reads `Postern uses Plaid to
connect your account`. Every Postern user sees that heading, because Postern sends the name.
Plaid asks for a phone number first. You do not need one.
Press **Continue without phone number**. It sits directly under the **Continue** button.
Type a number instead and Plaid may refuse it, even a working mobile. The screen then reads
`Invalid phone number` over `We couldn't verify that … is a valid number.` Press **Try again**,
then press **Continue without phone number**.
Plaid then shows `Select your institution`: a search field placeholdered `Search`, over a grid of
bank tiles. Press your bank's tile. The recorded run pressed `CHASE`.
Postern sends the United States as the only country, so the grid offers US banks.
Plaid may also show a banner that names your app and says it `is testing something new`. Plaid
builds that line from the name Postern sends. It appears for an app without full Production access,
and nothing in the Console turns it off.
A bank can also need time at Plaid before it works with a new app. Minutes to hours is usual.
Charles Schwab has taken up to about 6 weeks.
Plaid hands you to your bank. The handoff screen carries your bank's name. In the recorded run it
read `Log into Chase`, over `After logging into Chase, make sure you check all these boxes:`.
That screen shows one ticked box: `Share all accounts to see all your financial info with
Postern`. Plaid's own instruction is to check all the boxes it shows you. Do that at your bank
before you finish.
Press **Continue to login ⧉**. Your bank's own sign-in page opens.
Sign in there with your bank's own credentials. You never paste a bank password into Postern. Only a
token for that one bank comes back.
[Nothing outside your home has to reach your machine for this to work.](/reference/provider-sign-ins#plaid-never-shows-postern-your-bank-sign-in)
Your bank then asks which accounts to share. Tick every account you want an agent to read, and
approve. Your bank names its own screens and its own controls, so this page names none of them.
Whatever your bank offers to share, finance stays read-only. No agent can move money.
Plaid takes you back and ends on a success page. The captures of that run hold 2 wordings for it:
* `Success` over `Your account has been successfully linked to Postern`
* `Success!` over `Your information has been successfully shared. It's safe to close the browser now.`
Plaid may then offer to save the bank to your own Plaid profile. That screen carries your bank's
name — `Save Chase with Plaid` in the recorded run — over `Connect faster to 8,000+ Plaid-powered
apps`. Press **Finish without saving** to skip it. That offer is Plaid's, not Postern's.
Close the Plaid tab and go back to the Console tab.
Leave the **Link your banks** panel open. It checks every few seconds, and reads
`waiting for the first bank` until something lands.
When you finish at Plaid, the bank appears on that panel with the status `ok`. The button changes
from **Continue in Sources** to **Done — go to Sources**. Press it.
**Sources** now carries a **Plaid** group. Its row reads `byo app · finance` and
`feeds 1 bank · every 6h, all of them`, with **Add a bank** and **Edit app** beside it. Your bank
sits beneath it as its own row.
A bank that has not synced yet reads `0 accounts` under **Coverage**, and `never` under
**Last heard**. The **Finance** sector reads `Awaiting first sync`. That is normal.
Press **Sync now**, or wait.
Postern checks every Plaid bank at the same rate: every 6 hours, and never faster than 15 minutes.
A bank's own page shows that rate under **Poll cadence**, read-only. Beside it sit `— set once, for
all Plaid banks` and a link **Change it on the Plaid group →**. That link lands on **Sources**, which
carries no cadence control for Plaid. You cannot change the rate from the Console today.
One trip through Plaid Link links one bank. The panel says `bank(s)` because that is Plaid's
wording.
[A multi-bank trip needs a Plaid user token Postern cannot get.](/reference/provider-sign-ins#plaid-never-shows-postern-your-bank-sign-in)
For the next bank, open **Sources**, find the **Plaid** group header, and press **Add a bank**.
**Client ID** is already filled and the secret stays stored, so leave **Secret** blank.
Close Plaid's tab before you finish and nothing links. The panel still reads `waiting for the first
bank`, its button changes to **Done — go to Sources**, and no bank row appears. You linked nothing
and spent no slot. Press **Add a bank** and start again.
Bank consent expires about once a year, per bank. Capital One, Fidelity and Bank of America all
enforce it. A lapsed bank returns empty pages, which reads like a quiet week. Postern checks each
bank's standing and shows it instead.
In **Sources**, a lapsed bank's **Cadence** cell reads `consent lapsed`. Its last cell reads
**Reconnect →** rather than **Manage →**. Press **Reconnect →**.
On the connection page, press **Reconnect at Plaid**. Postern opens Plaid's re-approval page in a
new tab and says `Opened Plaid's re-approval page in a new tab.` Sign in at your bank there and
approve.
That re-approval address works for about 30 minutes, not 3 hours. This screen carries no re-open
button. If a pop-up blocker eats the tab, press **Reconnect at Plaid** again.
The re-approval runs against the same Item. No re-paste, no fresh trip through Plaid Link. The Item
keeps its identity,
carries on from where it stopped, and fills in what it missed. The row clears at the next check, up
to 6 hours away. **Sync now**, on the same page, checks at once.
Re-approval cannot fix these 2 cases.
Plaid no longer holds that bank's Item. Link the bank again: open **Sources**, then press
**Add a bank** on the **Plaid** group. On a Trial team that costs a slot.
Or your Plaid team hit its bank cap, or spent its credits. No re-link can work. Free a slot or
change your Plaid plan first.
A connection you disconnected has no credential left on your machine, and the Console says so
rather than offer a reconnect that cannot work.
## Sandbox is for testing only
Plaid's Sandbox links Plaid's own fake bank, not yours. **It is not the setup path.** Use it only if
you are testing Postern on a machine with no bank to link. For real use, go back to
[Copy your client ID and Production secret](#keys).
It does complete — the recorded run of 29–30 July 2026 walked it end to end and left a bank row in
the Console.
The Console has no environment picker. **Save & add a bank** saves your app as Production whatever
secret you type — the card's own note reads `Console defaults to Production.` So save the Sandbox app
past the Console, then use the Console's own button.
The command below writes over any Plaid app already saved here. Every bank that uses that app stops
until you save an app again.
Run this on the machine Postern runs on:
```bash theme={"system"}
curl -s -X POST http://localhost:8787/api/plaid/app \
-H 'content-type: application/json' \
-d '{"clientId":"YOUR_PLAID_CLIENT_ID","clientSecret":"YOUR_PLAID_SANDBOX_SECRET","env":"sandbox"}'
```
It answers `{"configured":true,"clientId":"YOUR_PLAID_CLIENT_ID","env":"sandbox"}`.
Now open **Sources**, press **Add a source**, then press **Plaid**. Leave **Secret** blank. Press
**Add a bank**. That button reuses the saved app and leaves its environment alone, so Plaid Link
opens on Sandbox. Every Plaid screen then carries the grey bar `You are currently in Sandbox mode.`
Walk it as [Get past Plaid's phone screen](#link-the-bank) describes. 3 things belong to Plaid's test
harness rather than to setup:
* The grey bar names the only number Plaid accepts here:
`You are currently in Sandbox mode. Sandbox » phone number: 415-555-0011`. You still do not need
one — **Continue without phone number** works.
* Press any bank tile. Sandbox sends you to its own test bank, `First Platypus Bank`, whichever tile
you pressed. Below that bank's sign-in form sits a strip with an `Error Selector` and a
`Submit Error` control, for forcing failures on purpose.
* The test bank takes any sign-in. The recorded run typed a username of its own. Plaid's published
test login is `user_good` / `pass_good`, and its published MFA code is `1234`. Its account picker
lists several invented accounts, `Plaid Checking ··· ··· 0000` among them. None is a real account.
It ends at `Success`, over `Your account has been successfully linked to Postern`.
`.env` is the other way in, and it dead-ends. Set `PLAID_CLIENT_ID`, `PLAID_SECRET` and
`PLAID_ENV=sandbox` in `.env`, beside `docker-compose.yml`, then run `docker compose up -d` again.
Postern reads those 3 variables only until you save a Plaid app. The Console cannot drive them: its
Plaid screen still reads `not configured`, and its only button saves a Production app, which
overwrites them. Use the command above instead.
To go back to Production, open **Settings**, find **Provider apps**, and press **Clear** on the
**Plaid** row. Then paste your Production keys at **Sources** → **Add a source** → **Plaid**. No bank
that used the old app refreshes again until you save one.
## Confirm it works
* **Sources** carries a **Plaid** group with one row per linked bank. The group's own line says how
many banks feed it.
* Each bank's **Cadence** cell reads a time, not `consent lapsed`.
* Open **Settings** and find **Provider apps**: **Plaid** reads `configured`.
* After the first sync, a bank's **Coverage** reads more than `0 accounts`, and its **Last heard**
reads a time rather than `never`.
* A bank that also arrives through SimpleFIN carries `also arrives via SimpleFIN — served as one`.
Postern merges 2 rows on its own only when both providers publish the last 4 digits. Otherwise it
asks `Is this the same account, seen twice?` on its own screen. Answer **They’re the same account**
or **Keep them separate**, and it stays answered.
* Ask an agent with a **finance** grant: *which finance sources can you see, and how fresh are they?*
It names the Plaid bank and its standing. It names the consent expiry date too, once Plaid
publishes one. You grant **finance** at **Agents & keys** —
[Connect an agent](/start/connect-an-agent).
## If something went wrong
| What you see | What to do |
| ------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Invalid phone number` over `We couldn't verify that … is a valid number.` | Plaid refused the number, and a working mobile can hit this. Press **Try again**, then press **Continue without phone number** — [Get past Plaid's phone screen](#link-the-bank). |
| No new tab opened after you pressed **Add a bank** | A pop-up blocker stopped it. Press **Re-open Plaid Link** on the **Link your banks** panel — [Save your app and open Plaid Link](#configure). |
| No Plaid Link tab opens, and the secret you saved was a Sandbox one | The Console saves every app as Production, so a Sandbox secret reaches Plaid's production host. Paste the Production secret into **Secret** — [Copy your client ID and Production secret](#keys). |
| The bank row reads `0 accounts` and `never` | Nothing has synced yet. Press **Manage →** on that row, then **Sync now** — [Watch the bank land in the Console](#first-bank). |
| **Reconnect at Plaid** does not bring a bank back | Plaid no longer holds that Item, or your Plaid team hit its bank cap or spent its credits. Link the bank again with **Add a bank**, or free a slot at Plaid — [Reconnect a bank when its consent lapses](#reconnect). |
| No bank refreshes any more after you pressed **Clear** in **Settings** → **Provider apps** | Postern no longer holds that app. Paste the `client_id` and the Production secret again — [Save your app and open Plaid Link](#configure). |
| The Console's Plaid screen reads `not configured` after you set the `PLAID_` variables | Environment variables never make that screen ready. Paste your keys at **Sources** → **Add a source** → **Plaid** instead — [Copy your client ID and Production secret](#keys). |
| `http://localhost:8787` does not open | Postern runs on another machine. [Set up remote access](/start/remote-access), then return to [Save your app and open Plaid Link](#configure). |
## What you have now
One connection for each bank you linked. Finance is read-only and carries no actions. No agent can
move money, and Postern never held the bank sign-in.
[Only Home Assistant carries actions today.](/reference/grants-and-sectors#which-sectors-an-agent-can-act-in)
Postern caches accounts, transactions and holdings on your own machine. An agent with a **finance**
grant answers from that cache. Where a bank also arrives through SimpleFIN, agents get one merged
row, and both provider rows stay readable.
[Plaid fixes the 2-year history window when you link the bank, and only a fresh trip through Plaid
Link widens it.](/reference/mcp-reading#four-properties-of-finance-data)
What this costs you from here:
* Plaid bills Production per linked bank, monthly, for as long as the bank stays linked.
* A balance an agent reads from the cache costs nothing. An explicit live balance costs money each
time: it goes to a Plaid endpoint Plaid bills per call.
* Consent expires about once a year, per bank. Postern shows the lapse but cannot renew it —
[Reconnect a bank when its consent lapses](#reconnect).
* Disconnect a bank and Postern tells Plaid to cancel that Item. That also stops Plaid's charge for
it, and Postern leaves your other Plaid banks alone. It is one-way: you cannot reconnect a bank you
disconnected or erased, only link it from the start, on a fresh slot.
## Next
an agent key, shown once · a few minutes, plus a restart of the client · you choose its sectors
when you create it
Health Auto Export on your iPhone · about 10 minutes · push, not pull
your own Google Cloud app + one app password · about 20 minutes · weekly re-consent until you
publish to production
# Connect SimpleFIN
Source: https://docs.getpostern.com/connect/simplefin
Accounts, balances and transactions from the banks you link at SimpleFIN Bridge. You paste one token — nothing to install, no developer account.
**Before you start**
* **A SimpleFIN Bridge subscription.** You pay SimpleFIN about \$1.50 a month at
[bridge.simplefin.org](https://bridge.simplefin.org). The Bridge's **Billing** page carries
today's price.
* **Your bank sign-in details.** You type them at the Bridge. Postern never sees a bank password.
* **Your password manager open.** The Bridge shows the setup token once, in
[step 2](#setup-token), and cannot show it again.
* **The Console.** Open `http://localhost:8787` in a browser on the machine Postern runs on. Only
this computer can reach these addresses. Nothing on your Wi-Fi, and nothing on the internet, can.
If that machine has no screen, [set up remote access](/start/remote-access) first.
* **About 5 minutes in Postern**, once you have linked your banks at the Bridge.
The SimpleFIN Bridge labels below come from the site as it stood on 6 August 2026. SimpleFIN renames
these screens, so trust your screen over this page.
## Choose your path
| If… | Then |
| ------------------------------------------------------ | ------------------------------------------------------------ |
| You have not linked your banks at SimpleFIN Bridge yet | Start at [Link your banks at SimpleFIN Bridge](#link-banks). |
| You already hold a setup token, or an access URL | Skip to [Paste the token into the Console](#paste-token). |
Open [bridge.simplefin.org](https://bridge.simplefin.org). It sends you to
`beta-bridge.simplefin.org`. That is the right site.
Create an account. Every page then carries the same four links across the top: **Home**,
**My account**, **Billing**, **Sign out**.
Open **Billing** and pay for your subscription.
Open **My account**. It offers two buttons. **New connection** adds a bank. **New app connection**
adds an app, which is the next step, not this one.
Press **New connection** and follow the Bridge's own screens for your bank. You type your bank
sign-in there. Postern never receives it, during this setup or afterwards.
Repeat for every bank you want covered, then come back to **My account**.
SimpleFIN arrives in Postern as one connection that holds every bank behind it. The Console has no
bank picker. To add or drop a bank later, come back to the Bridge. The change reaches Postern on
the next sync.
On **My account**, press **New app connection**. The page **Connect Application** opens, at
[beta-bridge.simplefin.org/my-account/tokens/create](https://beta-bridge.simplefin.org/my-account/tokens/create).
It carries one field, **Name / Description**, with the helper text `Use the name of the application
or any other description that will help you identify it in the future.` Type `Postern`.
Press **Create Setup Token**. The page **Setup Token Created** opens. Your setup token sits in a
bordered box on it, wrapped across about 4 lines.
That page says `Copy and paste the following SimpleFIN Setup Token into your application. This
will be the only time you see this code.` It means it. Copy the token before you leave the page —
the Bridge cannot show it to you again.
Press **Copy to clipboard**. If you select it by hand instead, take every line. A half-copied token
fails like a wrong one.
Treat the setup token like a bank password until you paste it.
Press **Return to My Account**. Your new entry now sits in the **Apps** table, under
**App**, **Last used** and **Status**, with **Disable** and **Delete** on its row.
If you lose the token before you paste it, press **New app connection** again and create another.
An unused token costs nothing.
In the Console, open **Sources**. Press **Add a source**, then press **SimpleFIN**.
Under the header **Paste it here** the card has one field, labelled **Access URL**, with the
placeholder `https://…@bridge.simplefin.org/…`.
Paste your setup token there. The field takes either form — a setup token, or a full access URL.
The field hides what you paste. It shows dots, not text, so you cannot read it back. That is normal.
You can use a setup token one time. Postern uses it up when you press **Connect SimpleFIN**. The
same token then fails everywhere, in Postern and in any other SimpleFIN app.
In exchange the Bridge hands back an access URL, and that line is itself a password: whoever holds
it can read every bank you linked. Postern encrypts it on your own machine and never shows it
again. [Postern stores the access URL, never the setup token](/reference/provider-sign-ins#three-credentials-that-behave-like-passwords)
Postern does not use up an access URL. It stores that line as it stands, so delete the copy you
pasted from.
Press **Connect SimpleFIN**. The Console shows `SimpleFIN connected.` and returns you to **Sources**,
with a SimpleFIN row on it.
Two answers appear in the field itself, before Postern contacts SimpleFIN.
`Paste your SimpleFIN access URL, or the setup token from the Bridge.` — the field is empty.
`That’s the bridge address, not your access URL. Yours starts with https:// and carries a token after the //.`
— you pasted `https://bridge.simplefin.org` on its own.
Postern has sent nothing to SimpleFIN. Paste the token and press **Connect SimpleFIN** again.
`SimpleFIN refused it.` over `simplefin setup-token claim failed` means the claim failed. Postern
saved nothing and left no half-connected source behind. Every cause gives that one message,
because Postern keeps credential fragments out of error text.
[Why one message covers every cause](/reference/provider-sign-ins#why-provider-failures-say-so-little)
Go back to the Bridge and [create another setup token](#setup-token). Paste that one. If you kept
an access URL, paste that instead.
If SimpleFIN is already connected, the card says so first:
`SimpleFIN is already connected. Connecting again replaces the stored credential — it won’t create a second copy.`
Tick **Yes — replace the stored credential.** to release the button, which then reads
**Reconnect SimpleFIN**.
Postern syncs the moment it connects, so `SimpleFIN connected.` also means the first sync worked.
In the Console, open **Sources**. The **Coverage** cell on the SimpleFIN row counts what arrived —
`3 accounts`, or `1 account` — and never `0 accounts`. Under the row Postern prints your banks'
names with `·` between them, then
`One link carries all — which banks are in it is chosen at SimpleFIN Bridge ↗`. With one bank
that line reads `One link carries it`.
What arrives: accounts with their balances, posted transactions, and investment positions for the
accounts that report them.
The first sync collects 1 year of history, so nothing older arrives. Every later sync asks for what
is new, plus the last 3 days again. Those 3 days catch a transaction that posts late. A second read
of the same 3 days changes nothing already stored. Pending charges never arrive: a card charge lands
once your bank finalises it.
[Backfill windows, the 3-day overlap, and posted-only reads](/reference/mcp-freshness#what-the-cache-holds-by-source)
`SimpleFIN is connected, but its first sync failed.` — the card stays put, with Postern's own
message underneath and a **Manage this connection →** link below it. The connection is real and
Postern rolls nothing back. Press that link, then press **Sync now**. It answers
`Synced — updated.` or shows the failure word for word.
A bank you linked at the Bridge is missing from the list, and nothing looks broken. One bank can
fail while the others succeed, and the Bridge reports that inside a normal answer. Postern keeps
everything that did arrive and does not delete that bank's holdings.
[Postern logs the bank that failed and keeps its holdings](/reference/mcp-freshness#a-simplefin-read-can-partly-fail)
To read the log, open a terminal on the machine Postern runs on. Go to the folder that holds
`docker-compose.yml`. Run:
```bash theme={"system"}
docker compose logs -f app
```
Look for lines that start `simplefin:`. Press Ctrl-C to stop.
In the Console, open **Sources**. On the SimpleFIN row, press **Manage →**, the last cell on the
right.
Under **Controls**, **Poll cadence** is a row of chips: `2h`, `6h`, `12h`, `1d`. That is how often
Postern checks for new data. A new connection sits on `6h`. Press another chip to change it. The
gloss under the chips reads
`How often Postern re-syncs this connection. Minimum 2h — a faster override is clamped to that floor.`
2h is the floor, and the Console offers nothing faster. SimpleFIN caps how many times a day a token
may ask, and disables a token that goes past that cap. Its own data refreshes about once a day, so a
faster check returns rows you already hold.
[The daily cap, and why 2h is the floor](/reference/mcp-freshness#what-the-cache-holds-by-source)
Your choice takes effect within about a minute. No restart. If the Console answers
`Cadence rejected.`, the change did not take: press the chip again.
## Confirm it works
* **Sources** shows a SimpleFIN row whose **Coverage** cell reads more than `0 accounts`.
* The line under that row names every bank you linked at the Bridge.
* The **Last heard** cell reads `just now`, or a time in minutes — not `never`.
* The connection page shows one **Poll cadence** chip already chosen.
* **Sync now** on that page answers `Synced — updated.`; a second run a minute later answers
with a smaller number, or `0`.
## If something went wrong
| What you see | What to do |
| ------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `SimpleFIN refused it.` | The claim failed and Postern saved nothing. At the Bridge, press **New app connection**, then **Create Setup Token**, then **Copy to clipboard**. Paste that new setup token. |
| `SimpleFIN is connected, but its first sync failed.` | Press **Manage this connection →**, then **Sync now**. It answers `Synced — updated.` or shows the failure word for word. |
| A bank is missing from the list under the SimpleFIN row | That bank failed this sync. Press **Sync now** on the connection page. If it is still missing, link that bank again at the Bridge with **New connection**. |
| `http://localhost:8787` does not open | Postern runs on another machine. [Set up remote access](/start/remote-access), then return to [Paste the token into the Console](#paste-token). |
## What you have now
One finance connection now covers every bank you linked at the Bridge: accounts and balances, posted
transactions, and investment positions where the bank reports them. Any agent you grant finance
reads it from your own machine.
Postern can only read your finances. It can never move money.
[Finance has no action catalogue; only Home Assistant can act](/reference/grants-and-sectors#which-sectors-an-agent-can-act-in)
Four things decide whether an agent's answer is right:
* Money out is a negative number, so a plain sum nets spending against income.
* SimpleFIN sends no categories. An absent category means *not categorised*.
* Investment positions are a snapshot, not a list of trades.
* A cost basis of `0.00` means *unknown*, not *free*.
[What an agent must know about these fields](/reference/mcp-reading#four-properties-of-finance-data)
Your subscription renews whether or not Postern runs, and SimpleFIN bills it. Which banks this
connection covers stays your decision at the Bridge.
To remove the connection, open **Sources** and press **Manage →** on the SimpleFIN row. Scroll to
**Lifecycle**, to the row **Disconnect Finance**, and press **Disconnect**. A confirm panel opens. It
names what it removes:
`Removes Finance's cached data and this connection. Re-add it anytime.` Type `disconnect` in the
field under **Type disconnect to confirm**, then press **Disconnect Finance**. Postern deletes this
connection's cached rows and the encrypted access URL. It sends nothing to the Bridge, so your
subscription and your linked banks stay as they are.
Add [Plaid](/connect/plaid) later for a bank the Bridge cannot reach. Postern merges an account that
arrives through both, but only when both report the last 4 digits. Otherwise it asks you to settle
it on its own screen.
[Postern never merges two accounts on a resemblance](/reference/grants-and-sectors#two-sources-inside-one-sector)
## Next
a key you created, and an agent that can reach the machine Postern runs on · a few minutes, plus
a restart of that agent
Health Auto Export on your iPhone · about 10 minutes · push, not pull
Other sources: [Home Assistant](/connect/home-assistant), [iCloud](/connect/icloud),
[Microsoft](/connect/microsoft), [WHOOP](/connect/whoop).
# Connect WHOOP
Source: https://docs.getpostern.com/connect/whoop
Recovery, sleep, strain, workouts and day-cycles, through a developer app you register once under your own WHOOP account.
**Before you start**
* **A WHOOP membership, and a WHOOP developer account.** The membership is the paid part. The
developer account, at `developer-dashboard.whoop.com`, costs nothing.
* **A Team at WHOOP, if this is your first app.** WHOOP asks a new developer account to create a
Team before its first app. Any name will do, and the Team needs no other members.
* **A web address to give WHOOP as your privacy policy.** WHOOP's app form asks for one and will
not take an empty field. You do not need a real privacy policy. WHOOP does not check the
address: Postern's own WHOOP app carries `https://dummy.com/privacy`.
* **Nothing to request from WHOOP.** A new app serves up to 10 WHOOP members without approval. You
are one of them. Approval is for an app you hand to other people.
* **About 10 minutes, in one sitting.** Postern remembers a sign-in you started for 10 minutes,
and lets you finish it once. Do not restart or update Postern while you work.
* **Postern started, with the Console open at `http://localhost:8787`.** WHOOP sends you back to
that address. Postern refuses a return under any other name, so finish the whole sign-in in that
browser. No Postern yet? [Install Postern](/start/install). Postern on a computer with no screen?
[Open the Console over SSH](/start/remote-access#ssh-tunnel) first.
* **A password manager, open.** WHOOP gives your app two values: a client ID and a client secret.
Postern needs both — [WHOOP refuses the sign-in without the secret](/reference/provider-sign-ins#what-each-provider-needs-and-why).
WHOOP shows the secret when it creates the app, then masks it. Copy it there and then.
Open the Console at `http://localhost:8787`. In the left navigation, click **Sources**. On that page,
click **Add a source**, then the **Whoop** tile.
The left column carries the heading **Register your app**. Its second step reads **Request the offline scope,
and add this redirect URI:**, with an address underneath.
Click **Copy** beside that address. The button answers **Copied**.
A redirect URI is the address the provider sends you back to after you approve. They match it
exactly, character for character. On a stock install this one reads:
```text theme={"system"}
http://localhost:8787/api/oauth/whoop/callback
```
Copy it from the screen, not from this page. It stays correct if you ever change the Console port —
[the Console prints the address Postern will send, never one it worked out itself](/reference/provider-sign-ins#the-redirect-address-is-pinned-inside-postern).
The Console calls it a redirect URI. WHOOP's form heads that section **REDIRECT URLS**. One address,
two names.
The address is missing. Its place is empty, or it holds a sentence. Empty means Postern has not
answered yet. A sentence is Postern's own error message. Open a terminal on the machine Postern
runs on. Go to the folder that holds `docker-compose.yml`. Run `docker compose ps` and wait until
`app` reads `healthy`. Then reload the Console screen.
Go to `developer-dashboard.whoop.com` and sign in with your WHOOP account. The signed-in page reads
**Your apps**, with **APPS**, **TEAM** and **DOCS** across the top right.
The Console's own first step names `developer.whoop.com`. That address is WHOOP's documentation
site. You create the app at `developer-dashboard.whoop.com`. Two addresses, one WHOOP.
If this is your first app, WHOOP asks you to create a Team before it opens the app form. Give the
Team any name.
Press **CREATE NEW APP**, top right. WHOOP opens a form titled **New App**.
Fill the three sections at the top of that form:
* **NAME** — type `Postern`. WHOOP's note reads "App name displayed to the user in the OAuth flow.",
and the field shows `App Name` until you type.
* **LOGO** — a `.jpg` or a `.png`. WHOOP's note reads "Logo displayed to the user in the OAuth flow.
This logo must be either .jpg or .png and will be displayed in 1:1 width/height pixel ratio." You
are the only person who ever sees it.
* **CONTACTS** — type your own email address into **Contact #1**. The field shows
`contact@example.com` until you type. WHOOP's note reads "Contact emails for this app.
Administrative communications from WHOOP concerning this app will be directed to these emails."
Tick all five read scopes below. Postern turns on the health sector only if WHOOP grants
`read:recovery`, `read:sleep` or `read:workout`. Grant none of those three and Postern creates no
connection at all — [the Console can only report the connection it made](/reference/grants-and-sectors#which-sectors-a-sign-in-turns-on).
Scroll down. Four more sections follow **CONTACTS**, in this order: **PRIVACY POLICY**, **REDIRECT
URLS**, **SCOPES**, **WEBHOOKS**. This form prints every section heading in capitals. The app's own
screen prints the same names in ordinary case later, so match a section by what it asks for.
**PRIVACY POLICY** — type any web address into the one field. WHOOP's note reads "Link to your
privacy policy. Users will be presented with this link in the OAuth flow.", and the field shows
`https://example.com/privacy` until you type. Nothing on screen marks the field required. Leave it
empty and WHOOP will not create the app. You do not need a real privacy policy, and WHOOP does not
check the address. Postern's own WHOOP app carries `https://dummy.com/privacy`.
**REDIRECT URLS** — paste the address you copied in [step 1](#redirect-uri) into **Redirect #1**.
Never type it by hand. The field shows `https://myapp.com/callback` until you paste. An **ADD**
button below the field adds another redirect. Postern needs one, so leave **ADD** alone.
WHOOP's note here reads "Location to which the user is taken after logging in. A valid redirect URL
will take the form of [https://whoop.com](https://whoop.com) or whoop\://example." Your address matches neither of those
shapes. It starts `http://`, and WHOOP accepts it. Postern's own WHOOP app is registered with that
exact address, and it syncs today.
**SCOPES** — six checkboxes, one per scope. WHOOP starts every one unticked. Tick the first five.
Leave `read:body_measurement` unticked: Postern never asks for it.
| scope | WHOOP's own description | what to do |
| ----------------------- | ------------------------------------------------------------------------------------------------------ | -------------- |
| `read:recovery` | Allows access to recovery information, including score, heart rate variability, and resting heart rate | Tick |
| `read:cycles` | Allows access to cycles information, including day strain and average heart rate during a cycle | Tick |
| `read:sleep` | Allows access to sleep information, such as duration and start and end time | Tick |
| `read:workout` | Allows access to workout information, including activity type and accumulated strain | Tick |
| `read:profile` | Allows access to profile information | Tick |
| `read:body_measurement` | Allows access to body measurements, such as height, weight, and max heart rate | Leave unticked |
Scopes are permissions — the list of things your app may read. WHOOP's own rule: "At least one scope
must be specified to create an App."
`offline` is not one of the six, and there is no checkbox for it. Do not hunt for one. Postern asks
WHOOP for `offline` on the sign-in request itself. The Console's own step reads **Request the offline
scope, and add this redirect URI:**. Postern makes that request. You register the address.
`offline` is not data. It lets Postern renew the sign-in without you. Without it the connection dies
the next day — [WHOOP will not renew a token without it](/reference/provider-sign-ins#what-each-provider-needs-and-why).
**WEBHOOKS** — leave this section alone. Postern uses no webhooks. WHOOP renders no field here until
you press **ADD**, so there is nothing to fill in.
Press **CREATE APP**, at the bottom of the form. Until you change something on the form that button
stays dim, and the line beneath it reads "Make a change to enable saving."
Your new app then sits under **Your apps**, and its card carries the app name and **CLIENT ID**.
Copy the client secret into your password manager before you leave this screen. WHOOP shows the
secret once, at creation. After that the app's **Credentials** section prints **Client Secret** as
a row of dots.
WHOOP hands the new app two values: a client ID and a client secret. Copy both into your password
manager. Postern needs both in the next step.
The client secret is a password. WHOOP's own words: it should "never be logged or shared with
anyone."
The client ID stays readable. Open the app from **APPS**, and **Credentials** prints **Client ID**
in full. WHOOP's own documentation says you can read both values later. That is true of the client
ID only. The secret prints as dots.
The same screen carries **Status**. WHOOP's words there: "Apps can be used for development
immediately with a limit of 10 WHOOP members. To launch your app to all WHOOP members, you must
submit your app for approval." You are the one member. Leave **Request Approval** alone.
**If you did not copy the secret.** Nothing breaks on its own. A connection that already signed in
carries on, because Postern holds the secret in the vault and renews the sign-in with it. You need
the secret again only to sign in again.
Look in your password manager first, then in the browser's saved form entries.
Then open the app at `developer-dashboard.whoop.com` and read the **Credentials** section. Nobody
here has seen whether WHOOP offers a replacement secret there. If it does, take it, then paste the
new pair into the Console.
If it does not, register a second app and leave the first one alone. WHOOP's own rule: "You can
create up to 5 Apps." Give the second app the same privacy policy address, the same redirect URL
and the same five scopes. Copy its client ID and secret, then paste the pair into the Console.
The first app holds the old sign-in until you finish. Do not delete it before then. Delete the app
your connection runs on and the next sync stops.
Go back to Console → Sources → **Add a source** → **Whoop**. The right column carries the heading
**Configure the app**.
Paste the client ID into **Client ID**. Paste the client secret into **Client secret**. Leave the
secret empty and the Console sends nothing. The field answers **Whoop is a confidential client —
paste the client secret too, or the sign-in will be refused.**
Sign in on WHOOP's page with the WHOOP account that wears the strap. A different WHOOP account
connects, looks healthy, and holds no data.
Press **Save & sign in with Whoop**. Postern stores both values encrypted, then sends you to WHOOP's
consent page. Approve there. WHOOP returns you to the Console's Sources page, and a message reads
**WHOOP connected — Health.** After this,
[the secret leaves your machine only to renew the sign-in](/reference/provider-sign-ins#what-each-provider-needs-and-why).
The new row reads **Awaiting first sync** until the first poll runs. It then reads **Syncing…**, with
a count of the rows so far on that first sync only.
You land back on the Console's Whoop screen, which reads **Whoop did not complete the sign-in.**
with a code beneath it in mono. The code is WHOOP's own. Three causes: you declined, the app at
WHOOP is set up wrong, or the client secret does not match the client ID. Correct the app at WHOOP,
or re-paste the pair, then press **Save & sign in with Whoop** again.
A bare page reads `{"error":"invalid or expired state"}` at the callback address, instead of the
Console. You took longer than 10 minutes, restarted Postern part-way, or opened the callback link a
second time. Postern stored nothing, and you lost nothing. Go back to Console → Sources → **Add a source**
→ **Whoop** and press **Save & sign in with Whoop** again.
Optional. Postern asks WHOOP for new data on a schedule, and you set it. Console → **Sources** →
click the WHOOP row. Under **Controls**, **Poll cadence** offers 15m, 30m, 1h, 6h, 12h and 1d. WHOOP
starts at 6h. 15m is the floor, and Postern clamps a faster value to it.
The first sync fetches the last 30 days, so it takes longer than the syncs after it. Each later sync
re-reads the last 3 days, so a night WHOOP scored late still lands.
Press **Sync now** on the same page to sync at once, rather than at the next poll.
Your app's own screen prints WHOOP's budget under **Rate Limits**: **API Minute Rate Limit** `100`
and **API Day Rate Limit** `10000`. A 15m poll is nowhere near either. Postern uses no webhooks, so
**Webhook URLs** on that screen stays at `No webhooks configured`.
## Confirm it works
* Console → **Sources** lists one **WHOOP** row, under Health.
* That row carries no label at all. There is no healthy badge in this Console.
* Open the WHOOP row: **Samples cached** reads a number above 0.
* **Last synced** shows a time, and **Next poll** shows one.
* Console → **Add a source** → **Whoop** now reads **Whoop is already connected. Signing in again
replaces the stored app and re-runs consent — it won’t create a second connection.**, with a
checkbox **Yes — replace the stored app and re-run consent.** and a button **Reconnect Whoop**.
## If something went wrong
| What you see | What to do |
| ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| WHOOP's app form will not submit — it wants a privacy policy | Type any web address into the field under **PRIVACY POLICY**. WHOOP does not check it. [Step 2](#create-app) has the detail. |
| The app's **Credentials** section prints **Client Secret** as dots | That is normal. WHOOP masks the secret after it creates the app. A connection that already signed in carries on. [Step 3](#copy-credentials) has the recovery path if you have no copy. |
| No address under **Request the offline scope, and add this redirect URI:** — an empty space, or a sentence | Postern has not answered the Console yet. [Step 1](#redirect-uri) has the check to run. |
| [**Whoop did not complete the sign-in.**](#sign-in) with a code beneath it | You declined, the app at WHOOP is set up wrong, or the secret does not match the ID. Correct the app at WHOOP or re-paste the pair, then press **Save & sign in with Whoop** again. |
| A bare `{"error":"invalid or expired state"}` page at the callback address | The 10 minutes ran out, Postern restarted, or you opened the callback link twice. Postern stored nothing. [Start the sign-in again](#sign-in). |
| [**WHOOP signed in, but granted no sectors. Check the scopes on your app, then sign in again.**](#create-app) | WHOOP granted none of `read:recovery`, `read:sleep`, `read:workout`. Open your app at `developer-dashboard.whoop.com`, tick all five read scopes, then sign in again. |
| The row reads **Stale**, days after a sign-in that worked | The last sync is late. Open the row and press **Sync now**. |
| The row reads **Unreachable** or **Disconnected** | **Unreachable**: Postern cannot reach WHOOP and retries on its own. If it persists, check that your app still exists at `developer-dashboard.whoop.com`. If it is gone, create it again — a new app carries a new client ID and secret, so [paste the new pair into the Console and sign in again](#sign-in). **Disconnected**: the credential is gone from the vault. Go to **Add a source** → **Whoop**, paste the client ID and secret again, and sign in. |
## What you have now
One health connection, on a credential you own. It carries recovery, sleep, day-strain, workouts and
day-cycles. Any agent you have granted the health sector can answer from it. You grant on the key,
not here — [connect an agent](/start/connect-an-agent).
WHOOP fills three kinds of row: sleep sessions, workouts and health samples. Recovery and the
day-cycle both land in samples, and the Console's **Samples cached** counts all three kinds together.
An agent asks for the samples by name:
`recovery_score` · `resting_heart_rate` · `hrv_rmssd` · `spo2` · `skin_temperature` · `day_strain` ·
`day_average_heart_rate` · `day_max_heart_rate` · `day_kilojoule`
`spo2` and `skin_temperature` come from the 4.0 strap only. On a 3.0 strap they stay empty.
`day_kilojoule` stays in kilojoules, while Postern converts workout energy to kcal. A night WHOOP has
not scored yet produces no rows at all. It appears on a later sync.
WHOOP is read-only. There is nothing here for an agent to act on —
[WHOOP offers no actions, and Postern refuses to run one](/reference/grants-and-sectors#which-sectors-an-agent-can-act-in).
What you carry from here: the WHOOP membership, and the app registration at WHOOP. Delete that app,
or let the sign-in lapse, and the next sync stops.
Disconnect in the Console. Postern then deletes the access token, the refresh token and the client
secret from the vault. [It also marks the connection and its credential revoked](/reference/vault#a-disconnect-removes-the-credential-not-the-data).
The connection's page then reads **This connection was removed — its credential is gone from the
vault. Syncing will not resume on its own; re-add the source to start a new connection.** Your synced
rows stay. To reconnect, paste the client ID and secret again.
## Next
An agent key, shown once · a few minutes, plus a restart of the client you connect · nothing
opened to the internet, unless the client is claude.ai or ChatGPT.
Health Auto Export on your iPhone · about 10 minutes · push, not pull. The Console's own WHOOP
screen names it: recovery, sleep and day-strain, alongside Apple Health.
# Postern
Source: https://docs.getpostern.com/index
A personal context gateway you run yourself. AI assistants ask Postern; Postern answers from your own machine.
Postern is a personal context gateway you run yourself. It covers six areas of your
life: finance, mail, calendar, contacts, health and home.
MCP is the standard way AI assistants connect to outside tools. Postern speaks it, so
Claude, ChatGPT and Cursor connect the same way.
Each agent gets its own key. A new key can reach nothing until you tick a sector.
Postern records what your agents do. Only Home Assistant lets an agent act as well as
read.
It runs on a machine you own. Agents connect to your machine, not to a Postern cloud.
Free and open source (Apache-2.0).
## The short version
Three commands, then one address. You need Docker, Git and a terminal. macOS and Linux
are the tested paths. Nobody has run Postern on Windows —
[Install Postern](/start/install) carries the untested Windows lines.
Keep `.env`. Postgres records that password on the first start, and it never accepts a
different one against the same data.
```bash theme={"system"}
git clone https://github.com/getpostern/postern.git && cd postern
printf 'POSTGRES_PASSWORD=%s\n' "$(openssl rand -hex 24)" > .env
docker compose up -d
```
The first run downloads the image, so it takes minutes. Then open
[http://localhost:8787](http://localhost:8787) — that is the Console.
Postern, its database and the Console start together, and Postern opens its ports to
this computer only.
[Only this computer can reach these addresses. Nothing on your Wi-Fi, and nothing on the internet, can.](/reference/security-model#the-trust-boundary)
[Install Postern](/start/install) covers the rest: the password you can never change,
what `docker compose down -v` destroys, and the Console from another computer. It also
does the same install without Git.
## Start here
Docker and a terminal · about 10 minutes · no cloud account
Tailscale, and Funnel only if a hosted agent needs a public address · about 20
minutes, once · off by default
a name, the sectors it opens, a deadline · a few minutes · Postern shows the key once
a key you created · a few minutes, plus a restart of the agent · claude.ai and
ChatGPT need a public address first
## Connect a source
Eight sources, each with its own page. Connect as many or as few as you want. A sector
answers with whatever you connected in it.
[A new source never changes a grant you already made.](/reference/grants-and-sectors#what-a-grant-covers)
* **Finance** — [SimpleFIN](/connect/simplefin), the one to start with; [Plaid](/connect/plaid) for banks SimpleFIN cannot reach
* **Mail, calendar and contacts** — [Google and Gmail](/connect/google), [Microsoft](/connect/microsoft), [iCloud](/connect/icloud)
* **Health** — [Apple Health](/connect/apple-health), which your iPhone sends; [WHOOP](/connect/whoop)
* **Home** — [Home Assistant](/connect/home-assistant), the only source an agent can act on
[ChatGPT](/connect/chatgpt) is not a source. It is an agent that reads from Postern,
and it needs a public address first.
## Understand how it works
* [Security model](/reference/security-model) — the premise the rest of this list follows from, and what has not been reviewed
* [Which computers can reach Postern](/reference/ports) — the two ports, and why the Console has no password
* [The vault and the master key](/reference/vault) — what Postern encrypts, what it does not, and the one command that destroys the key
* [Provider sign-ins](/reference/provider-sign-ins) — the redirect address, what each provider needs, and the credentials that behave like passwords
* [Grants and sectors](/reference/grants-and-sectors) — six sectors, nothing granted until you tick it, read and act together
* [MCP tools](/reference/mcp-primitives) — the address an agent connects to, and what every call returns
* [The OAuth bridge](/reference/oauth-bridge) — how a hosted agent signs in, and the eight addresses the internet reaches
* [Read data](/reference/mcp-reading) — `get_schema`, `query` and `get_record`
* [Freshness and live reads](/reference/mcp-freshness) — `describe_context`, `fetch_live`, and how often Postern checks
* [Act on a source](/reference/mcp-actions) — `list_actions` and `invoke_action`
* [The audit log](/reference/audit-log) — what a row holds, and what gets no row
* [Read the record](/reference/read-the-record) — the ledger screen and `GET /api/audit`
* [What the record cannot promise](/reference/record-limits) — what is dropped before it lands, and what nothing in the database prevents
## Where things are
* Source code — [github.com/getpostern/postern](https://github.com/getpostern/postern)
* Image — `ghcr.io/getpostern/postern`, for Intel, AMD and ARM machines
* [Back up, export and erase](/operate/backup-and-export)
* [Frequently asked questions](/about/faq)
# Back up, export and erase
Source: https://docs.getpostern.com/operate/backup-and-export
Save the master key and the database in one file, restore them on another machine, export your cached data as JSON, and erase it.
**Before you start**
* **A terminal on the machine Postern runs on.** Every command runs from the folder that holds
`docker-compose.yml` and `.env`.
* **Postern installed and running.** [Install Postern](/start/install) if it is not.
* **The Console cannot back up.** Settings → **Your data** has a **Back up now** row, and its
**Back up** button is disabled. The row says why:
`Backup runs on the box — its status isn’t served to the Console.` Backup runs on the machine
Postern runs on, and the Console is never told how it went.
* **Postern never backs up on its own.** You decide when to run this, and where the copy goes.
* **These commands are for macOS and Linux.** Postern runs under Docker, so it should also run
on Windows. Nobody has tested that. This page has no PowerShell form.
## Choose your path
| If you want to… | Then |
| -------------------------------------------------------------- | ------------------------------------------------------------------------ |
| protect yourself against the loss of this machine | [Check who holds the master key](#key-custody), then work down to step 6 |
| move Postern to another machine, or recover from a lost one | [Unpack the backup file on the new machine](#restore-unpack) |
| read your cached data somewhere else | [Export everything as one JSON file](#export) |
| destroy cached data — one connection, one sector, or all of it | [Choose what to erase](#erase-scope) |
A backup is one file that holds two things: the master key, and the Postgres database. Neither works
without the other.
Who holds the master key decides the next three steps. In the folder that holds
`docker-compose.yml`, run:
```bash theme={"system"}
grep -c '^PCI_MASTER_KEY=' .env
```
| It prints | Who holds the key | What to do |
| ------------------------------- | ----------------- | ---------------------------- |
| `0` | Postern | Follow every step below. |
| `1`, with a value after the `=` | You | Skip steps 2, 3 and 8. |
| `No such file or directory` | — | You are in the wrong folder. |
An empty `PCI_MASTER_KEY=` counts as `0`. Postern reads an empty value as no value.
**Postern holds it.** Postern makes a 32-byte key the first time it encrypts a credential. It is
not made at first boot. A Postern that has connected nothing has no key yet. Postern keeps the key
at `/app/.pci/master.key`, inside a Docker storage area named `pci_master_key`. The storage area
is the key.
**You hold it.** The value after the `=` is the key, and the storage area holds nothing to copy.
Store that value in your password manager, away from the database copy. On the new machine, put
`PCI_MASTER_KEY` — and `PCI_MASTER_KEY_ID`, if you set one — into `.env` before Postern's first
boot there.
`scripts/backup.sh` in the repository does not work on the shipped Docker layout. It exits with
`refusing a keyless backup` and writes nothing.
[Why, and what it does when you hold the key](/reference/vault#behaviours-you-will-meet)
Take the master key from the container, never from a `./.pci/master.key` file in your own folder.
That file is a **different key**. Paired with a database copy from the container, it makes a
backup file that restores cleanly and then decrypts nothing. Postern then refuses to start.
With Postern running, in the folder that holds `docker-compose.yml`, run:
```bash theme={"system"}
mkdir -p ./backup-staging && chmod 700 ./backup-staging
docker compose exec -T app cat /app/.pci/master.key > ./backup-staging/master.key
chmod 600 ./backup-staging/master.key
```
Check what you captured. On macOS:
```bash theme={"system"}
wc -c < ./backup-staging/master.key
shasum -a 256 ./backup-staging/master.key
```
On Linux, the second line is `sha256sum ./backup-staging/master.key`.
`wc -c` prints `32`. Anything else means you captured something other than the master key.
Write the checksum into your password manager, beside the name of the backup file you make in
step 5. You compare it at restore time. It proves a master key and a database copy came out of the
same backup file. Do not keep it only here — this is the machine you may lose.
Skip this step if step 2 worked.
If the `app` container is not running — including after Postern refused to start — the same bytes
sit in the storage area. Docker puts your folder's name in front of the storage area's name, so
resolve the real name first:
```bash theme={"system"}
KEYVOL=$(docker inspect -f '{{range .Mounts}}{{if eq .Destination "/app/.pci"}}{{.Name}}{{end}}{{end}}' \
"$(docker compose ps -aq app)")
docker run --rm -v "$KEYVOL":/k alpine cat /k/master.key > ./backup-staging/master.key
```
`echo "$KEYVOL"` prints a name that ends in `_pci_master_key`.
Now run the two checks from step 2, and write the checksum down the same way.
Postern can stay running for this. Optional: for a copy that nothing can change while it is made,
stop Postern first with `docker compose stop app`, and leave the database running.
In the same folder, run:
```bash theme={"system"}
docker compose exec -T db pg_dump -U pci -d pci -Fc > ./backup-staging/pci.dump
```
`-Fc` writes the compressed format that `pg_restore` reads back. No password is needed.
[Why](/reference/vault#behaviours-you-will-meet)
If you changed `POSTGRES_USER` or `POSTGRES_DB` in `.env`, use your own values in place of `pci`.
If you stopped Postern, start it again now:
```bash theme={"system"}
docker compose start app
```
`ls ./backup-staging` prints `master.key` and `pci.dump`.
Anyone who gets this file can read every password inside it. The lines below set mode `0600`.
Keep it that way.
In the same folder, run:
```bash theme={"system"}
tar -czf "postern-backup-$(date -u +%Y%m%dT%H%M%SZ).tar.gz" -C ./backup-staging .
chmod 600 postern-backup-*.tar.gz
rm -rf ./backup-staging
```
`ls postern-backup-*.tar.gz` prints one filename. It holds two files, and it is a backup only while
it holds both:
```text theme={"system"}
master.key 32 raw bytes (absent when you hold the key — that value lives in your .env)
pci.dump pg_dump -Fc
```
`docker compose down -v` deletes the storage area that holds the master key. With a current backup
file, that is recoverable.
Postern prints `VAULT KEY IS NOT BACKED UP` to its log on every boot — after a good backup, and
after a restore. It is a reminder, not an error, and no Console control clears it. To stop it,
write the marker file yourself or hold the key yourself:
[the backup banner](/reference/vault#the-backup-banner-and-how-to-stop-it)
Never rotate the master key between step 2 and step 4. A database copy older than a rotation needs
the older master key. Take a fresh backup immediately before any rotation, and keep the older
backup file until every connection reads `ok` again.
[How a rotation and a backup drift apart](/reference/vault#rotating-the-master-key)
A backup that lives only on the machine it protects is not a backup.
To another computer you can reach over SSH:
```bash theme={"system"}
scp postern-backup-*.tar.gz @:~/
```
To an external drive: plug it in, then copy the file across with `cp` or your file manager.
Set the file to mode `0600` on the far side. Record where you put it in your password manager,
beside the checksum from step 2.
The new machine needs Docker and the compose file first. Follow
[Install Postern](/start/install) to the end of its step 2: install Docker, download
`docker-compose.yml` into an empty folder, write a `POSTGRES_PASSWORD` line into `.env`. Compose
refuses to start without that password. Add back any other variables you had set. Do not start
Postern yet.
Bring the backup file into that folder. From another computer that holds it:
```bash theme={"system"}
scp @:~/postern-backup-*.tar.gz .
```
From an external drive, copy it across with `cp` or your file manager. Unpack it, and check the
master key against what you recorded:
```bash theme={"system"}
mkdir -p ./restore && chmod 700 ./restore
tar -xzf postern-backup-.tar.gz -C ./restore
wc -c < ./restore/master.key
shasum -a 256 ./restore/master.key
```
On Linux, the last line is `sha256sum ./restore/master.key`.
`wc -c` prints `32`, and the checksum equals the one in your password manager. A checksum that does
not match means the two halves come from different points in time. Postern will refuse to start
rather than half-work.
Skip this step if you hold the key. Put `PCI_MASTER_KEY`, and `PCI_MASTER_KEY_ID` if you used one,
into `.env` instead.
Boot is what opens the vault, so the master key must be in place before Postern's first start. In
the folder that holds `docker-compose.yml`, run:
```bash theme={"system"}
docker compose up -d db
docker compose create app
```
`docker compose create` makes the container but does not start it. That creates the `pci_master_key`
storage area, so there is somewhere to put the key.
Run `docker compose ps` and read the STATUS column of the `db` row. It says `health: starting`,
then `healthy`. The check runs every 5 seconds and gives up after 10 tries. A `db` row that never
reads `healthy` means Postgres did not start, and `docker compose logs db` says why.
With the `db` row healthy, run:
```bash theme={"system"}
KEYVOL=$(docker inspect -f '{{range .Mounts}}{{if eq .Destination "/app/.pci"}}{{.Name}}{{end}}{{end}}' \
"$(docker compose ps -aq app)")
docker run --rm -i -v "$KEYVOL":/k alpine \
sh -c 'cat > /k/master.key && chmod 600 /k/master.key && chown 1000:1000 /k/master.key' \
< ./restore/master.key
```
`1000:1000` is the `node` user Postern runs as. Postern cannot read a key it does not own.
**The first two lines destroy data.** They drop and recreate the database. Run them only when you
restore **over** an existing Postern. Nothing they delete is recoverable except from another
backup file. On a fresh machine the database is already empty: run the third line alone.
**Every line ends in `
```bash theme={"system"}
docker compose exec -T db dropdb -U pci --if-exists pci
In the same folder, run:
```bash theme={"system"}
docker compose up -d app
```
Run `docker compose ps` until the STATUS column of the `app` row reads `healthy`. Then run:
```bash theme={"system"}
docker compose logs app | grep -iE 'SecretAuth|MasterKey'
curl -fsS http://localhost:8787/healthz
```
The grep prints nothing, and `/healthz` answers `{"status":"ok"}`. That says Postern is running and
its database is reachable. It does not say the master key matches the vault. A
`VAULT KEY IS NOT BACKED UP` line is not a restore failure: the marker sat in the old volume and
the restore made a new one. [Write it again](/reference/vault#the-backup-banner-and-how-to-stop-it).
Now open a real credential:
1. Open the Console at `http://localhost:8787`. If Postern runs on another computer,
[forward the port over SSH](/start/remote-access#ssh-tunnel) first.
2. In the left rail, click **Sources**.
3. Click any connection except Apple Health. Apple Health is push-only: it has no **Sync now**
button, and shows **Pause receiving** instead.
4. On that connection's page, under **State**, click **Sync now**.
5. Its status reads `ok`.
A sync opens that connection's encrypted credential. Every connection back at `ok` is the only
end-to-end proof that the master key and the database copy belong together. Delete `./restore`, and
keep the backup file.
`SecretAuthError` or `MasterKeyError` in the log means the master key and the database copy are
from different points in time. So does a refusal to start that names a `key_id` it cannot open.
Check `PCI_MASTER_KEY_ID` first: Postern looks rows up by that label, so the key can be right and
only its label wrong. Otherwise capture the master key again from the old machine and restore again. If
the old machine is gone and the key went with it, the data cannot be recovered.
In the Console at `http://localhost:8787`, go to **Settings** → **Your data**. Find the
**Export everything** row and click **Export**. It downloads one file named
`postern-export-.json`.
The same bundle is a plain GET. Run it on the machine Postern runs on:
```bash theme={"system"}
curl -fsS http://localhost:8787/api/export -o postern-export.json
```
Only this computer can reach that address. Nothing on your Wi-Fi, and nothing on the internet, can.
From another computer, [forward the port over SSH](/start/remote-access#ssh-tunnel) first.
[Why the export answers here only](/reference/ports#the-console-has-no-authentication)
The file holds a `manifest` and a `data` object.
* `manifest` — the export timestamp, the sectors that had rows, and a row count per object. It also
lists your connections: connection id, provider, sector, status, last sync time.
* `data` — keyed by object: `finance.transaction`, `health.workout`, and for the sectors that hold
a single object the sector's own name, `mail`, `calendar`, `contacts`, `home`. It holds every live
row in full, including the `raw` payload the source returned.
Rows the source itself has deleted are not in it. They are gone at the source, not your data.
The export carries no credentials, no tokens and no access URLs. No route reads an export back in,
so you cannot restore Postern from one. To undo an erase, reconnect the source and sync it again.
Add `?sector=finance` to narrow the bundle to one sector's tables. The six sector names are
`finance`, `mail`, `calendar`, `contacts`, `health` and `home`. Any other name answers `400` with
`unknown sector: `.
Every export writes one row to Console → **The ledger** under the tool `export`. It carries the
sector if you narrowed it, and the number of rows, never the rows themselves.
[What one row holds](/reference/audit-log#what-one-row-holds)
Erase deletes the rows themselves. It is not a mark the next sync undoes. There is no undo and no
import: the export is a copy you can read, not a copy Postern can read back. One thing brings the
data back — reconnect the source and sync it again.
**On a Plaid connection, not even that.** Postern removes the Item at Plaid before it deletes a
row. A later sync cannot resume; it needs a brand-new Link. That also stops the paid
subscription those Items are billed under. The stop is best-effort, so check at Plaid afterwards
if the subscription matters to you. An Item is one bank connection at Plaid; Link is Plaid's
connect-your-bank window. [What Postern gets back from Plaid, and what it never sees](/reference/provider-sign-ins#plaid-never-shows-postern-your-bank-sign-in)
In the Console at `http://localhost:8787`, go to **Settings** → **Your data**. Find the
**Erase data** row and click **Erase…**. It opens its own page.
Pick one of the three scope cards. Each states what it reaches before anything happens:
* **One connection** — `Drop one source's cached rows.` That connection stays connected, and a sync
fills it again.
* **A sector** — `Everything in one sector, all providers.` Those connections stay connected.
* **Everything** — `Every sector, every connection.` Postern keeps its identity and your agent keys.
The data is gone.
**One connection** is selected first, as the least destructive. For **One connection** or
**A sector**, pick the target from the list under the cards. Then arm the erase:
1. Click **Export first**. The guard opens the moment you click, not when the download finishes —
so watch that the file arrives.
2. Type `ERASE` into the field labelled **Type ERASE to confirm**.
3. Click **Erase this connection**, **Erase this sector** or **Erase everything**.
If you change the target after that, both guards close again.
At every scope the connector and credential rows survive, so you can sync again without a fresh
connect. Plaid's credential is the exception: Postern marks it dead. The record of the erase
survives too, and it never held the row values.
[What one row holds](/reference/audit-log#what-one-row-holds)
Erase is not disconnect, and it is not revoke.
[The three are separate acts](/reference/agent-keys#what-a-revoke-does-not-touch)
The Console sends `ERASE` for every scope. Postern checks the name of the thing you erase. So
an erase from the Console can fail with `confirmation token does not match the requested scope`.
Nothing was deleted when it does: Postern checks the token before it touches a row. The commands
below are the form that goes through.
Run these on the machine Postern runs on, or through the
[SSH tunnel](/start/remote-access#ssh-tunnel) you use for the Console. Take the body for your scope.
One connection:
```bash theme={"system"}
curl -fsS -X POST http://localhost:8787/api/erase \
-H 'content-type: application/json' \
-d '{"scope":"connection","connectionId":"","confirm":""}'
```
One sector:
```bash theme={"system"}
curl -fsS -X POST http://localhost:8787/api/erase \
-H 'content-type: application/json' \
-d '{"scope":"sector","sector":"finance","confirm":"finance"}'
```
Everything:
```bash theme={"system"}
curl -fsS -X POST http://localhost:8787/api/erase \
-H 'content-type: application/json' \
-d '{"scope":"all","confirm":"ERASE-ALL"}'
```
For ``: the list on the Console's erase page shows only the first 8 characters. For
the full value, open `postern-export-.json` in a text editor, search for `connections`, and
copy the `connectionId` value.
It answers with the scope, a count of the rows deleted from each table, and the total. Tables that
lost nothing are left out. So a short answer on a machine with a lot of data usually means you named
a narrower scope than you meant. A connection id that is not yours answers `404` and deletes
nothing.
Running the same erase twice is safe. If an erase stops partway, run the same command again
to finish it. [Why](/reference/vault#behaviours-you-will-meet)
## Confirm it works
* `wc -c` on the captured `master.key` prints `32`.
* The checksum you compute after you unpack the file equals the one in your password manager.
* The backup file holds both `master.key` and `pci.dump`. When you hold the key it holds `pci.dump`
alone, and you can produce the `PCI_MASTER_KEY` value from where you stored it.
* The backup file also exists somewhere other than the machine Postern runs on.
* After a restore: a connection you clicked **Sync now** on reads `ok`.
## If something went wrong
| What you see | What to do |
| -------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `refusing a keyless backup` from `scripts/backup.sh` | That script reads a host path; the key is inside a Docker storage area. Ignore the script and follow [step 2](#capture-key). |
| `wc -c` prints anything other than `32` | Delete `./backup-staging/master.key` and redo [step 2](#capture-key) — or [step 3](#capture-key-stopped) if `docker compose exec` cannot reach the `app` container. |
| `SecretAuthError`, `MasterKeyError`, or a refusal to start that names a `key_id` | Check `PCI_MASTER_KEY_ID` in `.env` first. If that is right, capture the master key again from the old machine, then redo [step 8](#restore-key) and step 9. |
| `confirmation token does not match the requested scope` | Nothing was deleted. Postern wants the connection id, the sector name, or `ERASE-ALL` — not `ERASE`. Send the erase with the matching body: [step 13](#erase-send). |
## What you have now
One backup file at mode `0600`, with a 32-byte master key and a database copy that restore only
together. A second copy of that file sits off this machine. An export is separate: a readable JSON
snapshot of your cached data, with no credentials in it and no route that reads it back.
If you erased, the rows are gone and the record says so. A sync brings each source back — except a
Plaid connection, which needs a new Link.
## Next
Tailscale, and Funnel only if a hosted agent needs you · about 20 minutes, once · off by
default, and both tiers can be taken back down.
A running Postern and the Console in front of you · a few minutes, plus a restart of whatever
agent you connect · an agent key, shown once.
# Agent keys: create, expire, revoke, rotate
Source: https://docs.getpostern.com/reference/agent-keys
What an agent key is, the deadline it can carry, and the four operator verbs that change or end one — with the exact Console clicks and what the agent sees.
**Before you start**
* **Every control on this page is in one place.** Open the Console and click
**Agents & keys**.
* **A key and its grant are one row.** The key is the secret you paste into an
agent; the grant is the sector list on that same row. The sectors are on
[Grants and sectors](/reference/grants-and-sectors).
* **Postern cannot show you a key again.** It keeps a scrambled copy it can
check against, never the key itself.
* **Three of the four verbs end that agent's live sessions.** Expect to watch a
working agent stop.
## What an agent key is
A key is 32 random bytes from Node's cryptographic random source, encoded as
base64url. Postern stores the SHA-256 of it, in `agent_grants.key_hash`. Postern
cannot show you this key again. It keeps a scrambled copy it can check against,
never the key itself. No route returns it, not even the route that lists your
agents. A rotation is the only way to get a new one.
Postern hashes a presented key the same way and looks the result up. It never
compares the key as itself, never logs it, and never puts it in the record. A
lost key is created again, not recovered.
**To create one.** Click **Agents & keys**, then **Mint a key**. Type a name. Tap
sectors under **Grant which sectors**. Pick a chip under **Expires**. Press
**Mint the key**. One agent name holds one key, so **Mint a key** under a name
that already exists is a rotate, not a second key.
Three states refuse a key that resolves to no working grant: unknown key, revoked
key, expired key. [Why an agent was refused](/reference/refusals) carries what the
agent sees in each case, and which of them reaches the record.
## Expiry
A grant carries a deadline, and its default is none. Stored as null, the key
never expires.
The **Expires** row offers four chips: **Never**, **30 days**, **60 days** and
**90 days**. It starts on **90 days** once you have set a public address at
Console → **Settings** → **Remote access**, and on **Never** before that. Through
`POST /api/agents`, `expiresInDays` is a whole number of days from now between 1
and 3650; omit it and the key never expires.
| Once a deadline exists | What that means |
| ----------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- |
| A key is dead **at** its expiry instant, not after it | The comparison is inclusive. A deadline one millisecond in the past refuses. |
| Revocation wins over expiry | A key that is both revoked and lapsed reports `revoked`, because the revocation check runs first. |
| Postern re-checks the deadline on every call | A key that lapses inside a live session stops there, at its deadline. |
| A derived token cannot outlive the grant | A hosted agent holds a token from Postern's OAuth bridge. Its effective deadline is the earlier of its own and the grant's. |
A change to a deadline cuts live sessions exactly as a change to the sectors
does. Postern runs that sweep whether the change widens or narrows. The cost is
one reconnection.
Postern refuses to move the deadline of a dead key, and the refusal is in
Postern itself, not only in the Console. The Console explains it where it
happens: `This key is revoked, so its deadline is fixed where it stopped —
moving it would let the old key back in. Rotate to mint a fresh key with a new
deadline.` A lapsed key gets the sibling sentence: `This key has already
lapsed, and moving the deadline would let the old key back in — so Postern
refuses it. Rotate to mint a fresh key with a new deadline.`
Sectors on a dead key are a different case, and the two surfaces differ. Postern
accepts a sectors-only edit on a revoked or lapsed grant, because the sectors of
a key that cannot resolve do nothing. The Console disables the toggles once a key
is revoked and says `This key is revoked; its grants can no longer change.` On a
lapsed key it lets you toggle and says `Tap to toggle — but this key has lapsed,
so nothing reaches your gate with it until you rotate it.` Either way there is no
next session for new sectors to apply in. Rotation is the only route back.
### A key used from a company's cloud must carry an expiry
claude.ai and ChatGPT refuse an agent key that never expires, and Postern's own
OAuth bridge refuses one too. So a key you will paste into a hosted agent needs a
deadline before you use it: pick **30 days** or **90 days** on the **Expires**
row. The Console never blocks a key that never expires; it only moves the default
and states the reason.
[The refusal, its exact wording, and why the bridge is the only place that checks
it](/reference/oauth-bridge#a-hosted-agent-key-must-carry-an-expiry).
## Revoking, rotating, and removing
Four operator verbs act on a grant. All four are on the Console port, and no agent
can call any of them.
| Verb | The clicks | What changes in the row | What the agent gets |
| --------------- | --------------------------------------------------------------- | ------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------- |
| **Revoke** | **Agents & keys** → the agent → **Revoke** → **Revoke the key** | Postern writes a revocation stamp. Repeat it and nothing further changes. | The key stops working at once, on both the agent port and the REST read mirror, and its live sessions are cut. |
| **Rotate** | **Agents & keys** → the agent → **Rotate** → **Rotate the key** | New key hash, new sectors, new deadline, revocation cleared. The agent's name stays. | The old secret stops at once, and derived tokens are deleted. |
| **Edit grants** | **Agents & keys** → the agent → tap a sector under **Grants** | Postern replaces the sector list. | The current session ends; the next one carries the new sectors. |
| **Remove** | Revoke first, then **Remove** → **Remove the agent** | Postern deletes the row. | Nothing further. Its rows in the record survive. |
**Rotate** opens the same form as **Mint a key**, with the name locked and the
sectors and deadline preloaded. On an already-revoked agent that button reads
**Re-mint** instead. **Remove** appears only after a revoke, so nobody deletes a
live agent out from under an in-flight session.
A rotation is the answer to a leaked key, which is why the credentials derived
from it die with it.
The confirmation panel states the cost before you press: `The key stops working
immediately, and every token a hosted client (claude.ai, ChatGPT) holds through
it dies with it. Its entries in the ledger are kept. A session already under way
has resolved its grants and may finish; the next one is denied.` When it is done
the Console says ` revoked — every token derived from it died too.`, and a
remove says ` removed — its entries in the ledger are kept.`
**That panel's last clause is out of date, and you will still see it on screen.**
`A session already under way has resolved its grants and may finish` was true
before Postern began to cut sessions on a revoke. Postern now ends that session
too. The wording is a leftover; the sweep described below is what runs.
One thing the code does **not** settle: what becomes of a call that is already
inside Postern at the instant the sweep lands. What it does settle is that the
session is gone, and that no further call on it resolves. Nobody has established
the rest, and this page will not guess at it.
**Mint a key** under a name that already exists is a rotate, not a second key.
Postern replaces that agent's key hash, its sectors and its deadline, and
clears its revocation. The old secret stops at once. In the same transaction
Postern deletes every OAuth-bridge code and token derived from it, and ends its
live sessions. Postern stored only a hash of the old key, so no copy of it
exists anywhere. Every client that still holds the old secret has to be handed
the new one.
### Why a revoke reaches both surfaces
The REST read mirror re-resolves the presented key on every single request, so a
revoked key fails on the next call.
The agent port does not. It resolves the key once, at session start, and caches
the sector list in memory against the session id. A revocation written later
would never reach a session already open, so Postern pushes it instead. The
revoke route writes the row **first**. Then it evicts every cached session that
belongs to that agent, across every mounted surface, and closes each session's
transport. A sweep before the write would leave a window in which a fresh session
binds to a not-yet-revoked row. A session halfway through its start at that
instant is refused its binding, and the route reports how many it ended.
A hosted agent never holds the agent key. It holds a token that Postern's OAuth
bridge issues and refreshes, and Postern joins the grant row every time it
resolves one. So a revoked or expired grant refuses the derived token whatever
life the token has left of its own. A rotate goes further and deletes the derived
codes and tokens outright, because a rotate answers a compromise.
### What a revoke does not touch
Erase, disconnect and revoke are three separate acts. Erase drops cached rows and
leaves the connection connected and the credential in the vault. Disconnect
removes that connection's credential from the vault. Revoke ends an agent's key,
touches no source credential, and changes nothing upstream.
Postern never receives a provider password for an OAuth source. For Microsoft you
paste only an Application (client) ID, a public identifier, and Microsoft hands
back a scoped, revocable token. So a revoke — or a disconnect of Microsoft in the
Console — cannot touch your Microsoft account password; there is none here to
touch. You revoke the consent at Microsoft, and the app registration at Entra
stays yours.
A key cannot be un-revoked. Postern writes the revocation stamp once and no
path clears it, except a fresh key under the same name. That fresh key is a
different secret, and every client has to be handed it. Revoke when a key may
be loose, and know before you press that nothing any client currently holds
survives it.
## What the record holds about the key itself
Postern records nothing you do to a key. Create one, rotate one, edit its sectors
or its deadline, revoke it or remove it — the record gets no row for any of it. So
an agent can stop mid-work with nothing there to say why.
[What the record holds about a grant](/reference/refusals#what-the-record-holds-about-a-grant)
carries the rest, including why a **Remove** does not take the trail with it.
## Confirm it works
* Console → **Agents & keys** lists the agent, and its line reads `never expires`
or `expires in d`.
* On a revoked agent the buttons read **Re-mint** and **Remove**, and the toggles
under **Grants** will not move.
* After a revoke or a rotate, the agent's next call fails and its open session is
gone. Restart the client and it reconnects only with the new key.
## If something went wrong
| What you see | What to do |
| --------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| The agent worked yesterday and is refused today, with nothing changed | The key met its deadline. The agent sees `Unauthorized` (`401`) from the agent port, or `403` and `{"error":"access denied"}` from the REST read mirror. The agent port records the refusal with reason `expired`; the mirror records nothing. A dead key's deadline cannot be moved: click the agent, press **Rotate**, press **Rotate the key**, then paste the new key into the agent. |
| The Console refuses to move a deadline | The key is revoked or lapsed. Rotate it. A dead key's deadline is fixed where it stopped. |
| A hosted agent is refused at sign-in, and the key works locally | The key never expires. Rotate it with **30 days** or **90 days**, then sign in again. [The bridge's rule](/reference/oauth-bridge#a-hosted-agent-key-must-carry-an-expiry). |
| You revoked a key by mistake | Nothing un-revokes it. Press **Rotate** — on a revoked agent the button reads **Re-mint** — and hand every client the new key. |
## What you have now
What a key is, what a deadline does to it, and the four verbs that change or end
one. A revoke or a rotate ends every token derived from that key at once, and
cuts the sessions the agent is holding. Nothing at the source changes.
## Next
the two refusal shapes, the three key reasons, and which of them reach the
record
the six sectors, what one grant covers, and where every control that changes
a grant lives
# The audit log
Source: https://docs.getpostern.com/reference/audit-log
What one row holds, what gets a row, and what does not.
**Before you start**
* **You can read this only on the machine Postern runs on.** From your own
computer, forward the port first, then open `http://localhost:8787`:
```bash theme={"system"}
ssh -L 8787:localhost:8787 you@the-machine
```
* **It grows forever.** Nothing in Postern deletes a row and there is no
retention job. You must trim it, back it up and provide the disk yourself.
* **There is nothing to switch on.** The migrations create the `audit_log` table
at first boot, and the writer starts with Postern. No setting turns it off.
Three names, one thing. **The record** is the history of agent calls. **The
ledger** is the Console screen that shows it. `audit_log` is the table that holds
it. You need no agent key to read it: whether you can reach this computer is the
whole of the authorization.
**The record tells you what your agents did. It does not tell you what you did to
your agents.** Six acts leave no row at all: create a key, rotate one, edit its
sectors or its deadline, revoke it, delete it, and set a connection's sync window.
Postern records everything else on this page. And nothing here stops anything:
the record is a witness, never a guard.
Two more pages carry the rest of the record.
[Read the record](/reference/read-the-record) is the ledger screen and
`GET /api/audit` — the filters, the paging and **Export CSV**.
[What the record cannot promise](/reference/record-limits) is how far it can be
trusted — what is dropped before it lands, what nothing in the database prevents,
and the five questions it cannot answer.
## What one row holds
One row is one recorded call. Postern writes rows in batches with a single
`INSERT`. It binds every value as a parameter, so no argument an agent sent ever
reaches SQL as text.
| Column | Type | What it holds |
| -------------- | ------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `id` | `bigserial` | Primary key, and the tiebreak that makes pages exact. Every row in one flush shares a `created_at` to the microsecond. |
| `user_id` | `uuid` | References `users(id)`; null when no user resolved. **Not served over the API, not shown in the Console.** |
| `agent_id` | `text` | The agent's own name; `operator` for a Console action; null for a refused handshake and a device push. Plain text, no foreign key. |
| `tool` | `text` | The verb. Not null, free text. See below. |
| `sector` | `text` | The sector the call happened in, or null. |
| `decision` | `text` | `allow` or `deny`, only ever those two. Not null. |
| `deny_reason` | `text` | `unknown agent`, `revoked` or `expired` when Postern refused the key. Only the agent port ever writes those three. `access denied: ` when the key was good and the grant was not; both surfaces write that one. |
| `args` | `jsonb` | The call's parameters, redacted and size-capped before Postern queued them. |
| `result_count` | `int` | Rows returned on a read. On a device push, records upserted plus deleted. |
| `outcome` | `text` | `ok` or `error`. Actions record what the connector reported; reads record `ok`. |
| `request_id` | `text` | The MCP request id, to line a row up against a client's own log. |
| `created_at` | `timestamptz` | Set by the database at insert time. |
One index: `(user_id, created_at desc)`.
`created_at` is when the row was **inserted**, not when the call happened. Postern
flushes every 1000 ms by default, so a stamp trails its call by up to that much.
Every row in one flush carries the same instant, and under load the gap widens.
Nothing records the call's own time.
## What gets a row
**Agent calls — all seven tools.** `describe_context`, `get_schema`, `query`,
`get_record`, `fetch_live`, `list_actions`, `invoke_action`. The agent port writes
a row for every one, served or refused. The REST read mirror carries the five
reads, and writes the same row for those. The agent key is never in any field, on
any branch.
That covers a **sector** refusal on both surfaces. A refused **key** is the one
asymmetry, and [what does not get a row](#what-does-not-get-a-row) has it.
A refusal writes `decision: deny` with the reason. A call Postern allowed, which
then failed at the work, writes `decision: allow` with `outcome: error`. The
Console paints that third state as **Errored**.
**Console actions.** These carry `agent_id` of `operator`, always write
`decision: allow`, and carry `outcome` of `ok` or `error`.
| Verb | What it was |
| --------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
| `pause` · `resume` · `sync_now` · `disconnect` | You paused, resumed, synced or removed a connection |
| `revoke` | You revoked **a source's credential** — not an agent key |
| `set_sync_interval` | You changed how often Postern checks a source |
| `set_plaid_app` · `delete_plaid_app` | You set or removed your own Plaid credentials |
| `set_exposure` · `clear_exposure` | You set or cleared the public address |
| `finance.dedup.confirm` · `finance.dedup.unconfirm` | You merged or unmerged two finance rows |
| `export` | Carries the sector if you narrowed it, and the row count — never the rows |
| `erase` | Carries `{scope, connectionId?, sector?}` and the number of rows deleted. A failed erase is recorded too, with `outcome: "error"` |
**The handshake and the bridge.**
* `initialize` — Postern writes this **only on a refusal**, with `agent_id` null.
It always writes a key that was presented and refused. It writes an anonymous
probe that carries no key only when the OAuth bridge is on. A successful session
start writes nothing; the first tool call is what appears.
* `oauth_token` — the bridge issued or refreshed a token for a hosted agent. An
allowed row carries `{ grant: "authorization_code" | "refresh_token", clientId }`.
* `ingest` — a device pushed records over a webhook. `agent_id` is null; an
unauthorized push writes `deny` with `unauthorized`.
Postern caps two kinds of refusal on the agent port, each at 30 a minute. Past the
cap it counts them rather than records them. Refused `initialize` calls get the
summary row `throttled: initialize denials coalesced`. The bridge's cheap
refusals — an unknown client, an address that does not match, a stale form — get
`throttled: further bridge denials suppressed`. Both land at the **start of the
next window, and only if another refusal arrives**. So if the flood stops, the
count goes with it. Under a flood, "no row" no longer means "nothing arrived".
**A refused agent key is never one of the counted ones.** At the sign-in page the
bridge records every one, at any rate: `authorize: key refused`. A key that never
expires gets `authorize: key has no expiry`. A rate you would suppress is the
alarm itself.
## What does not get a row
Six Console acts write no row at all: create a key, rotate one, edit an agent's
sectors or its deadline, revoke the agent, delete the agent, and set a
connection's sync window. Five of the six are agent-key management — the acts
you would most want a record of. Keep your own note.
Four of those five end every live session that agent holds: a rotate, an edit to
its sectors or its deadline, a revoke and a remove. So an agent can stop
mid-work with nothing in the record to say why.
[What each verb does](/reference/agent-keys#revoking-rotating-and-removing).
Two traps in that list. The `revoke` verb above is **a source credential**, not an
agent. And `set_sync_interval` is a different control from the sync window, and
**is** recorded.
**Postern does not record reads you make yourself.** The Console's data inspector
is `POST /api/data/:sector` and `GET /api/data/:sector/:id`. It runs the same
query engine an agent runs, as the operator with every sector granted, and writes
nothing. Nor do `GET /api/operator/context`, `GET /api/operator/schema`, reads of
the record itself, or **Export CSV**.
[Why reachability here counts as operator trust](/reference/ports#the-console-has-no-authentication).
**On the REST read mirror, a refused key leaves no row.** That covers both
refusals it can give: a missing or malformed key (`401`), and an unknown, revoked
or expired key (`403`). The handler resolves the key first and writes the row
second, so a key that never resolves fails before the write runs. An ungranted
*sector* is different: the key resolved, so Postern records that refusal.
**On the agent port, the same refused key does leave a row** — against the tool
`initialize`, with the reason under `deny_reason`, no agent name, and no sector. A
reason never travels in the sector column, so a sector filter never shows that
row. One surface remembers a bad key and the other does not.
[The two refusals](/reference/refusals#the-two-refusals).
The line falls where a call touches a source or changes state, not where it only
reads. Postern records an operator `fetch_live`, because it reaches a source and
changes the cache. It records `export` too, which returns the whole store.
The record is not a list of everything that has read your data. You can read
every row of every sector through the Console's inspector and leave no trace. So
can anything else on that machine that can reach the Console port. What the
record answers completely is which **agent** came through and what it asked for.
What it cannot answer is who has seen this data.
## What the arguments hold
`args` is the call's own parameters — the query, the action target and its values
— stored as JSON. Two defences run before Postern queues the entry.
* **Field names.** Postern replaces any value whose field name contains `pass`,
`secret`, `token`, `key`, `authorization` or `cookie` with `[redacted]`,
matched without regard to case. It recurses through nested objects and arrays.
* **Size.** Past roughly 4 KB serialized, the whole payload collapses to
`[truncated]`. So does a cyclic or non-serializable value.
The honest bound: **redaction matches field names, never values.** Put a secret in
a value under a name the pattern does not match, and Postern records it as it
arrived. Secrets are not meant to travel in tool arguments. This list is a second
line, not the first.
The record holds the act, never the row values. `result_count` is a count; what a
read returned is not in the table.
The Console renders `args` two ways. The table drops fields whose value is null.
The row detail panel prints them whole under **Args (redacted, verbatim)**, and
**Export CSV** carries them exactly as recorded.
## What you have now
A record of every agent call and of the Console verbs listed above. It does not
cover agent-key management, and it does not cover reads you make yourself.
## Next
the ledger screen and `GET /api/audit` — filters, paging, and Export CSV
what is dropped before it lands, and what nothing in the database prevents
a running Postern and an agent key · a few minutes, plus a restart of your
client · a key shown once
what a grant covers, and how to revoke, rotate or expire one
# Grants and sectors
Source: https://docs.getpostern.com/reference/grants-and-sectors
The six sectors, which sectors a sign-in turns on, what one grant covers, and where every control that changes a grant lives in the Console.
**Before you start**
* **Every control on this page is in one place.** Open the Console and click
**Agents & keys**.
* **A grant is the sector list on one agent's key.** It is not a separate
object. It exists from the moment you create that key.
* **A sector is one area of your life: finance, mail, calendar, contacts,
health, home. It is the smallest thing you can grant.**
* **A change to a grant cuts that agent's live sessions.** The new sectors
apply at the agent's next session, never inside the one it holds.
* **Two neighbouring pages carry the rest.** The key itself — its deadline, and
how to revoke, rotate or remove it — is on
[Agent keys](/reference/agent-keys). What an agent sees when a grant says no is
on [Why an agent was refused](/reference/refusals).
## The six sectors
Postern sorts everything it holds into six sectors. The six are fixed: you
cannot add one, rename one or split one.
| Sector | What an agent reads in it | Sources that fill it |
| ---------- | ------------------------------------------------------------- | ------------------------- |
| `finance` | `finance.account`, `finance.transaction`, `finance.holding` | Plaid, SimpleFIN |
| `health` | `health.sample`, `health.workout`, `health.sleep_session` | WHOOP, Apple Health |
| `mail` | message envelopes. Postern never caches bodies or attachments | Gmail, Microsoft, iCloud |
| `contacts` | one address-book entry per source | Google, Microsoft, iCloud |
| `calendar` | event occurrences, one row per instance | Google, Microsoft, iCloud |
| `home` | the last known state of each device or entity | Home Assistant |
A grant names a sector, never a source. You choose what an agent reads when you
create its key, not when you connect a source. Grant `mail` and that key reads
every mail source you have now, and every one you add later. There is no way to
grant one and withhold another. Disconnect a source and the grant does not
change — the sector holds less. A key that holds none of a source's sectors sees
nothing, however many sources you connect.
### Which sectors a sign-in turns on
Postern reads the scope list the provider returns with the token, not the list
Postern asked for. It creates one connection per sector that list covers.
* **Google** — one sign-in becomes two connections, `calendar` and `contacts`,
because the consent covered two sectors.
* **Microsoft** — Postern requests exactly `Mail.Read`, `Calendars.Read`,
`Contacts.Read` and `offline_access`, and nothing else on any sign-in. That
gives three connections. A consent that grants fewer gives fewer connections;
sign in again and approve the whole set.
* **WHOOP** — `read:recovery`, `read:sleep` and `read:workout` each map to
`health`. `read:cycles`, `read:profile` and `offline` map to no sector at all.
A consent that returns none of the three health scopes creates no connection. The
Console then answers `WHOOP signed in, but granted no sectors. Check the scopes
on your app, then sign in again.` It can only report the connection it made. It
cannot name the scope it did not get.
### Two sources inside one sector
SimpleFIN arrives as one connection that holds every bank linked at the Bridge.
The Console has no bank picker. SimpleFIN Bridge decides which banks it covers,
and a bank added or dropped there appears or disappears on the next sync. The
**Sources** row says so, with your own bank count in place of ``:
`One link carries all — which banks are in it is chosen at SimpleFIN Bridge ↗`.
Connect Plaid as well and the same account can arrive through both. Postern's
dedup engine matches on the institution's domain plus the last 4 digits in the
account name, and serves one account rather than two. It merges on its own only
when both providers report a last 4. When one does not, it refuses to guess and
asks `Is this the same account, seen twice?` Answer once with **They're the same
account** or **Keep them separate**, and it stays answered.
### A granted sector with no source behind it
It is still granted, and it answers nothing. `describe_context` returns the
sectors the key was **granted**, not the sectors that hold data. A `query` there
comes back empty rather than refused, and `fetch_live` answers `no active
connection for sector ''`. Neither is a permission problem, and neither
looks like one in the record.
## What a grant covers
A grant works at the level of a whole sector. The same sector list gates reads
and actions, with nothing per-action, per-tier or per-confirmation beneath it.
The Console says so under the sector toggles: `Each granted sector covers read
and act across every provider in it.`
There is no confirmation step between an agent's decision and your house, and a
hosted agent asks no permission per call. Your instruction to the agent is the
authorization. The sectors you tick at creation are the whole boundary between
that agent and your data, for as long as the key lives.
### Which sectors an agent can act in
| Sector | Can an agent act in it? |
| --------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
| `home` | **Yes.** Home Assistant serves a live action catalogue, built from its own entity-and-service registry. |
| `finance`, `health`, `mail`, `contacts`, `calendar` | **No.** Every connector in these five declares an empty action list, so `list_actions` returns nothing and `invoke_action` has nothing to call. |
The **Mint a key** form states it before you grant anything: `A grant covers read
and act, but only Home has a catalogue to act on today; Finance, Mail, Calendar,
Contacts, Health are read-only.`
So no agent can move money through Postern, whatever its grant says. Google's
`calendar` and `contacts` are read-only twice over: the two scopes Postern
requests are read-only, and the connector refuses to run an action. WHOOP is the
same.
That is a statement about connectors, not about the permission model. If a source
adds actions later, keys that already hold that sector can use them. Nothing in a
grant names an action, so Postern re-issues nothing and asks nobody again.
### What the grant decides, tool by tool
| Tool | What the grant decides |
| --------------------- | ------------------------------------------------------------------------------------------------- |
| `describe_context` | Answers with the granted sector list, and only connections inside it |
| `get_schema` | Objects in ungranted sectors are absent rather than refused, so nothing leaks about what exists |
| `query`, `get_record` | Denied before Postern composes any SQL |
| `fetch_live` | Denied before any SQL, and before Postern touches anything upstream |
| `list_actions` | Lists the granted sectors; a named ungranted one is denied |
| `invoke_action` | Every action name starts with its sector (`home.light.turn_on`), and that sector decides the call |
Nothing is narrower than a sector. There is no per-connector, per-tool or
per-call gating underneath a grant. Parameters and returns are on
[MCP tools](/reference/mcp-primitives).
[Refused, or quietly filtered](/reference/refusals#refused-or-quietly-filtered)
carries the exact wording an agent gets back in each row of that table.
An agent whose key opens `finance` is served the accounts, transactions and
holdings in the local cache, plus each connection's health. Once Plaid reports
one, Postern also serves the date that bank's consent expires.
## Read a grant, and change it
**To read what a key holds.** Click **Agents & keys**, then the agent's name. The
lit toggles under **Grants** are its sectors. The line under the name reads
`never expires` or `expires in 60d`. The section headed **Recent passage** lists
that key's last calls.
A change to a grant cuts that agent's live sessions. Postern applies the new
sectors at the agent's next session, never inside the one it holds. If the
agent is at work, expect to watch it stop.
**To change the sectors.** On that same page, tap a sector under **Grants**.
Postern saves at once — there is no Save button. The hint under the toggles then
reads `Tap to toggle; the change applies at the agent's next session.`
**To create a key.** Click **Agents & keys**, then **Mint a key**. Type a name.
Tap sectors under **Grant which sectors**. Pick a chip under **Expires**. Press
**Mint the key**. Postern cannot show you this key again. It keeps a scrambled
copy it can check against, never the key itself.
One agent name holds one grant, and the record stores that name against every
call the key makes. A second key under an existing name is a rotate — see
[Revoking, rotating, and removing](/reference/agent-keys#revoking-rotating-and-removing).
**Through the API instead.** `POST /api/agents` creates or replaces a grant, and
`PATCH /api/agents/` edits one. Both take a `sectors` array of strings and
an optional `expiresInDays` between 1 and 3650. Both answer only on the machine
Postern runs on.
The deadline on the **Expires** row, and the four verbs that end a key, are on
[Agent keys](/reference/agent-keys).
## Default-deny
A new key can reach nothing until you tick a sector.
The sector list starts empty. A key with an empty list resolves, authenticates
and connects, and then every sector check denies it. A freshly installed Postern
answers on the agent port and grants nothing at all.
Postern does not treat that as an error, and the Console does not block it:
**Mint the key** needs a name and nothing else. The form says so three times.
| Where on the form | What it reads |
| ------------------------ | ----------------------------------------------------------------------------------------- |
| Under the sector toggles | `Nothing is granted until you pick it. Tap a sector to toggle it.` |
| Beside the recap | `no sectors — this key is denied everything` |
| Under **Mint the key** | `No sectors granted yet — this key would be denied everything until you edit its grants.` |
That is the intended shape rather than a defect, and it is why a connection that
succeeds can still answer nothing.
A key granted no sectors connects successfully and is denied on every read. The
connection is fine and the answers are empty, so nothing in your agent looks
wrong. `describe_context` gives it away: it comes back with `sectors: []`. To
fix it, click **Agents & keys**, click that agent's row to open its own page,
and look under **Grants**. No sector switched on is the fault. Switch one on
there. Nothing about the agent's config changes.
Two behaviours of the stored list matter if you write one through the API.
* **A sector name Postern does not recognise is dropped, silently.** Postern
intersects the stored list with the six real sectors when the key resolves. A
grant of `finance` and `bogus` grants finance and raises nothing. The endpoint
checks only that the field is an array of strings. If a sector you wrote does
not appear on the key, check its spelling against the six above.
* **`*` expands to every sector.** A stored grant of `["*"]` resolves to all six
at connection time. The Console cannot write one, because its toggles are built
from the six named sectors. A wildcard grant can only arrive through
`POST /api/agents`.
## What Postern cannot express
A grant row holds a user, an agent name, a hash of the key, an array of sectors,
a creation stamp, a revocation stamp and a deadline. Nothing else. So there is:
* no grant of one source inside a sector while another in the same sector is
withheld;
* no per-object, per-field or per-row grant;
* no read-only grant — read and act travel together, and the only thing that
limits action today is that five of the six sectors have no action catalogue
behind them;
* no per-call approval, no confirmation tier, no rate limit, no budget, no
time-of-day window;
* no per-sector deadline. One deadline covers the whole key;
* one grant per agent name, so two policies mean two agents.
The record is the compensating control for all of that. It tells you what an
agent did, after it did it. It never stops anything.
Per-user separation is real in the code. Every read is scoped to a user id, and a
key that belongs to one user cannot reach another's rows. But a self-hosted
Postern seeds a single operator user and treats its id as a constant. Multi-user
is future work, not shipped behaviour, and this page describes the single-user
shape you have.
## Confirm it works
* Console → **Agents & keys** lists the agent, and its line reads `never expires`
or `expires in d`.
* Click the agent. The toggles under **Grants** are lit for exactly the sectors
you meant to grant.
* Ask the agent what it can see. It names those same sectors and no others.
* Ask the agent for something in a sector you did not grant. It is refused, and a
row appears under **Recent passage** with `deny`.
## If something went wrong
| What you see | What to do |
| --------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------ |
| The agent connected, and every read comes back denied | The key has no sectors. Click **Agents & keys**, click the agent, tap a sector under **Grants**, then restart the agent. |
| A sector is granted and every query comes back empty, or `no active connection for sector ''` | Nothing is connected in that sector. Click **Sources** and connect one. This is not a permission problem. |
| You asked an agent to act and it reports there is nothing to act on | Only `home` has an action catalogue today. The other five sectors are read-only, and no grant changes that. |
| The agent worked yesterday and is refused today, with nothing changed | The key met its deadline, not a grant. [Expiry](/reference/agent-keys#expiry) carries the fix. |
## What you have now
The six sectors, which sectors a sign-in turns on, what one grant covers, and
where every control that changes a grant lives in the Console. A grant covers
read and act, and only `home` has anything to act on today. Nothing is granted
until you tick it.
## Next
the deadline on a key, and the four verbs that end one: revoke, rotate, edit
and remove
what one row holds, what gets a row, and the honest limits of a record the
database does not enforce
a running Postern and a key you created · a few minutes, plus a restart of
whatever client you are connecting
# Act on a source: list_actions, invoke_action
Source: https://docs.getpostern.com/reference/mcp-actions
The write side: what the sources let an agent do, how one action is dispatched, why `ok: false` is a successful call, and what Postern never runs.
**Before you start**
* **Home Assistant is the only source Postern can change today.** The other five
sectors are read-only, so an empty action catalogue is a normal answer.
* **A granted sector covers reading and acting together.** There is no separate
action permission and no confirmation step.
[What a grant covers](/reference/grants-and-sectors#what-a-grant-covers).
* **Postern sends each dispatch once and never re-sends it.** A break mid-call is
reported as unknown, not retried.
Nothing on this page was captured from a run. The shapes are the declared types, and
the quoted strings are Postern's own.
## list\_actions
What the connected sources let you do — the write-side counterpart of `get_schema`.
Served from the cache and a static catalog, not from a live poll.
One sector. Omitted, it enumerates every granted sector.
Passed to the connector verbatim. The connector owns its meaning.
The cheapest filter. It matches the entity-class prefix — `light`, `lock`, `climate`.
One device. Note the wire name: `entity_id` here, `entityId` at the connector.
Capped at 500. Must be an integer of 1 or more.
```ts theme={"system"}
{
actions: {
id: string
description: string
params: { name: string, type: "string" | "number" | "boolean", required: boolean, description?: string }[]
domain?: string
service?: string
target?: { area?: boolean, entity?: boolean, domain?: string }
}[]
count: number
truncated: boolean
}
```
Read-only sectors contribute nothing, so an empty catalog is a normal answer. Only Home
Assistant has an action catalogue today. The other five sectors have none at all.
`count` is what this response holds. `truncated: true` means the cap trimmed the
catalog. Narrow with `domain`, `area` or `entity_id` rather than raise `limit`. Postern takes
the cut off the end of the list it has built up, so it can drop a whole group of
actions at once.
`domain`, `service` and `target` are filled in by connectors that build their catalog
from a live source's own entities. A connector with a fixed catalog leaves them
undefined.
`list_actions` is filtered to your grants rather than refused, unless you name a
sector — naming an ungranted one is a refusal.
[Why an agent was refused](/reference/refusals).
### Where the Home Assistant catalogue comes from
Home Assistant will not tell you which services apply to which entity. Postern works
that out and serves the answer from cache, so discovery costs an agent no round trip to
your house. The catalog comes from the live connection's cache and from nowhere else.
An empty catalog for `home` therefore means the connection is not up.
### The admin and system services Postern never runs
The `hassio`, `update` and `backup` domains, `homeassistant.restart`,
`homeassistant.stop`, and every `reload` are dropped from the catalog and refused again
at dispatch. Name one directly and Postern still refuses it:
`admin/system service not permitted (device/entity control only)`.
## invoke\_action
Perform one declared action on a source. This is the only tool that changes anything
outside Postern, and Home Assistant is the only source it can change today.
Sector-namespaced, and taken from `list_actions` — `home.light.turn_on`,
`home.lock.lock`. Never guessed: the leading segment is what the grant is checked
against.
The action's parameters, including its target. An explicit id, or a structured
selector — area, domain, name — which Postern resolves against its own cache, so
"the kitchen light" is one call.
```ts theme={"system"}
{ ok: boolean, detail?: unknown }
```
`detail` carries the source's own response or its error summary. The record keeps the
action id, the parameters you sent, and whether the outcome was ok or an error — not
`detail` itself.
Postern passes `params` to the connector as given, and does not check them against the
action's declared `params` first. A malformed parameter surfaces as the source's own
error inside `detail`. The types in `list_actions` are there for you to check against
before you call.
**Postern sends each dispatch once and never re-sends it.** If the connection breaks
mid-call, Postern reports `unknown — not retried` rather than tries again. It cannot
know whether the source acted before the wire went, and a second send could act twice
on a real device. Check the device yourself.
A sector with no active connection returns
`{ ok: false, detail: "no active connection for sector ''" }`, and a provider
with no registered connector returns
`{ ok: false, detail: "no connector registered for " }`. Both are ordinary
results.
`ok: false` is a **successful tool call**. The call did not error and your agent will not
flag it. An agent that only checks for tool errors will report a light as switched
on when the source refused. Read the field. Postern records it too: the row for a
rejected action is allow with an error outcome. That tells the owner Postern
permitted the call and the source said no.
## Next
The one source an agent can act on today.
The address, the transport, and what every tool call returns.
# Freshness and live reads: describe_context, fetch_live
Source: https://docs.getpostern.com/reference/mcp-freshness
How old the data is, what to do about it, the one read that leaves the cache, and how often Postern checks each source.
**Before you start**
* **Every other read is served from the cache.** `query` and `get_record` never leave
it. [Read data](/reference/mcp-reading).
* **`describe_context` answers first.** It reports what this key can reach and how
old each connection is, and it takes no parameters.
* **A push connection has nothing to pull.** Your phone sends data to Postern when it
decides to. Postern cannot ask for it, so there is no **Sync now** button.
One question runs through this page: how old is this data, and what do I do about it.
`describe_context` reports freshness. `fetch_live` is the only path that leaves the
cache. The table at the end says how often Postern checks each source, and why.
Nothing on this page was captured from a run. The shapes are the declared types, and
the quoted strings are Postern's own.
## describe\_context
What this key can reach: the sectors it was granted, and every connection the owner
has in those sectors. Takes no parameters.
```ts theme={"system"}
{
sectors: string[]
connections: {
connection_id: string
provider: string
sector: string
status: string
label: string | null
last_synced_at: unknown
mode: "poll" | "push" | "on_demand" | null
health: { status: string; consentExpiresAt: string | null } | null
freshness: {
state:
| "ok" | "syncing" | "stale" | "unreachable"
| "error" | "paused" | "disconnected" | "never_synced"
last_heard_at: string | null
next_expected_at: string | null
stream_state: "connected" | "retrying" | "down" | null
error: { message: string; since: string | null } | null
}
}[]
}
```
`sectors` is the **granted** list, not the connected list. A granted sector can hold
no connection at all, so read `connections` alongside it. Connections whose status is
active, error, syncing or paused are all listed. Only revoked ones are left out.
Postern derives `freshness` in one place, inside itself, and serves it identically to
the Console and to `describe_context`. Trust it over any raw timestamp.
| Field | What it holds |
| ------------------ | ---------------------------------------------------------------------------------------- |
| `last_heard_at` | The last-synced clock, as ISO-8601. |
| `last_synced_at` | The same clock as the database holds it. Declared `unknown`, never promised as a string. |
| `next_expected_at` | Computed for poll connections only. |
| `mode` | `null` when no connector is registered for that provider. |
| `health` | Filled in for Plaid connections. `null` for every other provider. |
`mode` and `freshness` together decide whether a `fetch_live` is worth making:
| State | What to do |
| ---------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| A push connection reading `ok` | Already live. Skip the `fetch_live`. |
| A poll or on-demand connection | Goes stale between syncs. |
| `unreachable` | A push stream is down or retrying, and the cache is ageing behind a connection that still looks active. |
| `health.status: "action_required"` | The bank link is broken and the cache is stale, even though the last-synced clock kept advancing. A reconnect for the owner, not something an agent can retry around. |
A connection listed with `freshness.state: "error"`, `mode: null`, `health: null` and
`error.message: "freshness derivation failed"` is a degraded row, not a dead source.
Its own facts — provider, sector, status, last-synced clock — are still true. Only
the derivation failed.
## fetch\_live
The one read-time path to a source. `query` and `get_record` never leave the cache.
This does, on request, and within a bound.
Without `id`, a bare sector name or a dotted key both cover the whole sector. With
`id`, a multi-object sector needs the dotted key.
Present, this fetches that one record from its own source connection. Absent, it
syncs the sector.
```ts theme={"system"}
// without id — sync the sector and wait
{
sector: string
mode: "sync"
synced: boolean
timed_out: boolean
last_synced_at: string | null
errors?: string[]
connections: {
connection_id: string
provider: string
mode: "poll" | "push" | "on_demand" | null
freshness: Freshness // the same shape describe_context serves
}[]
}
// with id — fetch that record from its source
{
sector: string
mode: "record"
id: string
record: unknown // the untouched provider payload; null = the source says it is gone
}
```
Sync mode runs a sync-now across every active poll or on-demand connection in the
sector, and waits at most 30 seconds. **`timed_out: true` means Postern stopped
waiting, not that the sync stopped.** The syncs continue in the background. Re-read
`describe_context` rather than call again. Running the same one twice is safe.
Postern does not fold two overlapping calls into one, so two agents that ask at the
same moment start two syncs.
Push connections have no pull to run, and Postern does not quietly count them as fine.
A push stream that is down or retrying contributes an attributed line to `errors[]` and
forces `synced: false`. That is a reconnect for the owner, not a retry for the agent.
Error text is stripped of anything sensitive before you see it.
`connections[]` carries each connection's freshness re-read **after** the wait,
including connections whose sync failed in it. A sector with no active connection at
all is a not-found refusal rather than an empty success.
Record mode resolves the connection from the row itself, so a sector holding two
providers reaches the right one. Not every connector implements a live record fetch,
and one without it refuses with `live record fetch not supported for `. This
page carries no list of which do — Postern's own refusal is the authority. Live fetches
for footprint-limited sectors, mail bodies among them, are returned to you and never
stored.
## What the cache holds, by source
How often Postern checks a source, and what it keeps, changes what an agent can ask
for.
| Source | How often Postern checks | Floor |
| --------------- | ------------------------ | --------- |
| iCloud mail | every 10 minutes | 5 minutes |
| iCloud calendar | every 15 minutes | 5 minutes |
| iCloud contacts | every 15 minutes | 5 minutes |
| SimpleFIN | every 6 hours | 2 hours |
Apple publishes no rate limits for mail, calendar or contacts, so those intervals are
deliberately conservative. A calendar or address book that has not changed since the
last check costs one cheap probe rather than a full read. So a short interval buys
little, and a long one loses little.
SimpleFIN Bridge expects no more than 24 requests a day per token, and it disables a
token that goes past its warning level. Four scheduled syncs a day leaves most of that
budget for **Sync now** and for `fetch_live`. The Bridge refreshes what it holds roughly
daily, so a shorter interval returns rows Postern already holds.
**iCloud mail stores the envelope only** — sender, subject, dates and flags. Bodies and
attachments are never stored. When an agent asks for one message, Postern fetches that
body from Apple on demand and does not keep it. That survives a change to **Recency
window**. Envelopes newer than the window stay cached. Older mail is still readable,
one message at a time, live from Apple. Change the window and Postern clears the marker of
how far the connection has read, so the next run re-reads the whole window from the start.
On a large mailbox that is minutes of work, and **Envelopes cached** falls before it climbs.
**SimpleFIN's first sync backfills 365 days.** Postern asks for it in windows of 90
days or less, edge to edge with no gaps, because the Bridge silently caps a longer
span. Nothing older than a year is ever fetched. Every later sync requests from the
stored cursor minus a 3-day overlap, which catches a transaction the bank posts a couple
of days late. A second read of the overlap changes nothing already stored.
**Postern requests posted transactions only.** Pending charges are excluded by request,
not lost. A card charge appears when the bank finalises it, not when it is authorised —
usually a day or two after the spend. An agent asked "what did I spend today" will miss
today's unsettled card activity. That is the source's behaviour, not a sync fault.
### A SimpleFIN read can partly fail
The Bridge reports a failed bank inside an otherwise normal answer, as a per-bank error
string rather than as an error response. Postern keeps everything that did arrive and
writes each string to its own log under the prefix `simplefin:`. It also skips the
investment-position sweep for that round, so a bank that failed to answer does not have
its holdings marked as gone.
## Next
`get_schema`, `query` and `get_record` — every parameter and every refusal.
`list_actions` and `invoke_action` — the write side.
# MCP tools
Source: https://docs.getpostern.com/reference/mcp-primitives
How an agent connects: the address, the transport, the key it sends, what every tool call returns, and where each tool is documented.
**Before you start**
* **A running Postern of your own.** Every address here belongs to one install.
There is no shared address. [Install Postern](/start/install).
* **An agent key.** The sectors granted to it decide what every tool below
answers. [Connect an agent](/start/connect-an-agent).
* **An agent that speaks MCP over Streamable HTTP.** That is the one transport
Postern offers. Most agents speak it.
* **The address, copied from the Console.** A guessed address looks right and
silently does not work.
MCP is the standard way AI assistants connect to outside tools. Postern speaks it,
so Claude, ChatGPT and Cursor connect the same way.
Nothing on this page was captured from a run. The shapes are the declared types, and
the quoted strings are Postern's own.
## The seven tools
Seven tools, three pages. Each page answers one question, so the traps that belong
together stay together.
| Tool | What it answers | Where it is written up |
| ------------------ | -------------------------------------------------------------- | --------------------------------------------------------------------- |
| `get_schema` | The objects and fields you can ask for | [Read data](/reference/mcp-reading#get_schema) |
| `query` | A structured read over one sector | [Read data](/reference/mcp-reading#query) |
| `get_record` | One stored record by id | [Read data](/reference/mcp-reading#get_record) |
| `describe_context` | What this key can reach, and how old each connection's data is | [Freshness and live reads](/reference/mcp-freshness#describe_context) |
| `fetch_live` | The one read that leaves the cache | [Freshness and live reads](/reference/mcp-freshness#fetch_live) |
| `list_actions` | What the connected sources let you do | [Act on a source](/reference/mcp-actions#list_actions) |
| `invoke_action` | Perform one of those actions | [Act on a source](/reference/mcp-actions#invoke_action) |
A hosted agent — claude.ai or ChatGPT, running on a company's servers — cannot send
a fixed key at all, and signs in through a bridge instead.
[The OAuth bridge](/reference/oauth-bridge).
## The endpoint
Postern listens on two ports. Agents use **the agent port**. The Console uses **the
Console port**. Everything here is the agent port, except
[the REST read mirror](#the-rest-read-mirror).
The agent port answers `POST`, `GET` and `DELETE` on the path `/mcp`. Until you give
Postern a public address, that is the only path it serves.
| Request | Answer |
| ------------------------------------------------------ | ------------------------------------------------------- |
| `POST /mcp`, `initialize`, no key or a key it refuses | 401, code `-32001`, `Unauthorized` |
| `POST /mcp`, `initialize`, past 512 open sessions | 503, code `-32000`, `Too many sessions` |
| `POST /mcp` with no session header and no `initialize` | 400, code `-32000`, `Missing or invalid Mcp-Session-Id` |
| `GET /mcp` with no session header | the same 400 |
| `DELETE /mcp` naming a session Postern does not hold | 404, code `-32001`, `Unknown session` |
| Any path but `/mcp` | 404, code `-32601`, `Not found` |
A session starts with a `POST` that carries an `initialize` request and no session
header. Postern reads the agent key, resolves it once, and returns an
`Mcp-Session-Id`. Every later request carries that header. `DELETE` ends the session.
Past 512 sessions Postern refuses a new one and never drops a live one. Only a caller
that already holds a valid key reaches that check.
### Copy the address from the Console
1. In the left nav, click **Agents & keys**.
2. Scroll to the **Connect an agent** band.
3. Read the value under **MCP endpoint**.
4. Click **Copy** beside it.
Postern reports the address it is actually serving. Do not assemble one by hand.
If that band prints `This gateway isn’t serving MCP, so it has no address to point an
agent at. Set MCP_HTTP_PORT on the box and restart it.`, no agent port is running.
The port is a setting, not a constant, and `8788` is the default. To move it:
1. On the machine Postern runs on, open `.env` — the settings file beside
`docker-compose.yml`.
2. Set `MCP_HTTP_PORT` to the port you want. Save the file.
3. In that same folder, run `docker compose up -d`.
Postern serves the new port after that restart.
### Postern offers no stdio
Some agents can only start a program and talk to it directly. That is stdio, and
Postern does not offer it.
stdio works only when your agent starts Postern itself, as its own child process. The
Postern that serves your Console already runs and already owns its stdin. Under the
Docker setup there is no stdin to reach at all. A second Postern beside it would use
its own encryption key, and it could open none of the accounts you have connected.
Postern does hold one stdio session of its own, on its own stdin. That session resolves
as the local operator, with every sector granted and no key involved. That is exactly
why Postern never offers it to an agent.
An agent that only speaks stdio needs `mcp-remote` in front of the same URL. The
Console's own answer is the **Remote · bearer** config block below.
### Claude Desktop
**Claude Desktop is supported, through `mcp-remote`.** It takes the same `/mcp`
address and the same `Authorization: Bearer ` header as every
other client. It reaches the same agent port and meets the same key check. Its
config file is `claude_desktop_config.json`; on macOS that is
`~/Library/Application Support/Claude/claude_desktop_config.json`.
**Nobody at Postern has run that recipe end to end.** The exact `command` and
`args` for the `mcp-remote` bridge come from that project's own documentation,
not from a run against Postern. So this page does not print them as a verified
block. Copy the **Remote · bearer** config from the Console, put `mcp-remote` in
front of the URL, and expect to adjust it.
## How a client authenticates
Nobody types an HTTP header. You paste a config block:
```json theme={"system"}
{
"mcpServers": {
"postern": {
"type": "http",
"url": "",
"headers": { "Authorization": "Bearer " }
}
}
}
```
`type: "http"` marks this as Streamable HTTP in the `mcpServers` shape. It is the key
those config files read.
To get it filled in: click **Agents & keys**, scroll to **Connect an agent**, then
click **Copy recipe · keyless** under **Remote · bearer**. Paste the whole object into
your agent's MCP config file — `.mcp.json` for Claude Code, `mcp.json` for Cursor.
Replace `` with your own key. Restart the agent.
Postern matches the header name and the word `Bearer` without regard to case. A
`Bearer` with no key behind it counts as no key at all.
Postern compares the SHA-256 of the key you present against the hash stored with the
grant. It never stores the key, never logs it, and never puts it in the record. A lost
key is created again, not recovered.
[What an agent key is](/reference/agent-keys#what-an-agent-key-is).
Postern checks the key once, when the agent connects, and remembers the answer for that
session. Later tool calls do not re-read the database.
Three states end a key — unknown, revoked and expired — and the refusal at connect
names which one it was. [Why an agent was refused](/reference/refusals).
A key is dead **at** its expiry instant, and Postern checks the deadline on every
call. An open session stops answering the moment its key expires.
[Expiry](/reference/agent-keys#expiry).
Four acts end every live session that agent holds, at once: an edit to its
grants, an edit to its expiry, a rotation of its key, and a revoke or delete.
A session that was still starting up is refused too. Postern only has
to sweep the agent port. The REST read mirror re-checks the key on every single
request, so it never held a stale answer to sweep. The agent must connect again,
and the new grants apply from that new session.
[Revoking, rotating and removing](/reference/agent-keys#revoking-rotating-and-removing).
**A grant decides what every tool answers.** Grants are per sector and default-deny: a
new key can reach nothing until you switch on a sector, and a granted sector covers
reading **and** acting there. A key granted no sectors connects successfully and is
then denied on every read, so nothing in your agent looks wrong; `describe_context`
gives it away, coming back with `sectors: []`.
[What the grant decides, tool by tool](/reference/grants-and-sectors#what-the-grant-decides-tool-by-tool)
is the per-tool effect, and [why an agent was refused](/reference/refusals) is the
shape of each refusal.
## What a tool call returns
Every tool answers with one text block holding the result as JSON, indented two spaces:
```ts theme={"system"}
{ content: [{ type: "text", text: string }] }
```
Tools are the entire surface. Postern registers no resources and no prompts.
A refusal or a failure comes back as a **tool error** carrying Postern's own message. It
is not a transport error and not a broken session. This page quotes only Postern's half
of the string; how your agent wraps it is not recorded here.
An action the source itself rejects is not an error. `invoke_action` returns `ok: false`
as an ordinary result. See [invoke\_action](/reference/mcp-actions#invoke_action).
There are no rate limits in the tool path. The bridge's own addresses are metered.
Postern writes a row for every tool call inside a live session — served, refused or
failed. The write happens off the response path, so it costs the call nothing, and the
key is never one of the fields. A key refused at *connect* is a different path: the
agent port records that, and the REST read mirror does not. Read it at
Console → **The ledger**. [What gets a row](/reference/audit-log#what-gets-a-row).
## What the agent is told at connect
Postern introduces itself as `postern` and ships this text in the `initialize` result,
where it stays in the agent's context for the whole session:
```text theme={"system"}
Postern is this person's personal context gateway: one authenticated surface over
the sectors of their life (finance, health, mail, contacts, calendar, home). Reads
are served from a local cache in milliseconds; `fetch_live` is the only path that
touches a source at read time. Start with `describe_context` (what you are granted,
and each connection's freshness), then `get_schema` for the object you want — read
its `notes` and `fieldDocs` before composing any filter or aggregate; they carry
sign conventions and unit traps that the types do not. `query` reads ONE sector:
there are no cross-sector joins, so fan out and correlate yourself. Responses are
capped — `has_more: true` means you are looking at a page, not an answer.
`list_actions` / `invoke_action` act on a source; a granted sector covers both
reading and acting. Never assume a field's meaning from its name.
```
Each tool carries its own description on top of that, and those descriptions are where
the per-tool traps live.
## The REST read mirror
Every read an agent can make over MCP is also available over plain HTTP, for tools that
do not speak MCP. The Console port serves five of them, gated by the same agent key and
recorded the same way:
```text theme={"system"}
GET /api/context
GET /api/schema?sector=
POST /api/query
GET /api/records/:sector/:id
POST /api/fetch_live
```
They call the same core functions and answer the same shapes as the tools above.
**The mirror carries reads only.** There is no `invoke_action` on it. To act on a
source — which today means Home Assistant and nothing else — an agent must use MCP.
Postern resolves the identity on **every** request here rather than once per session,
so the mirror has no session to sweep and no session-cached grant.
The mirror is on the Console port, not the agent port, and `docker-compose.yml` opens
that port to this computer only. A public address opens the agent port to the
internet. It never opens this one.
## If something went wrong
Every string below is Postern's own. Your agent may print more around it.
| What you see | What to do |
| ------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| The agent connects and every read is denied | No sector is switched on. Click **Agents & keys**, click that agent's row, switch on a sector under **Grants**, then reconnect the agent. |
| 404, `Not found`, on a path you expected to exist | Postern serves `/mcp` and nothing else until it has a public address. Check that the `url` in your config ends in `/mcp`. |
| A hosted agent says it could not reach you, and nothing appears in your logs | Nothing arrived. Hosted agents connect out on port 443 only. Move the address to 443, wait five minutes, then try once. [Hosted agents connect out on port 443 only](/reference/oauth-bridge#hosted-agents-connect-out-on-port-443-only). |
| Your agent can only launch a command and will not take a web address | Postern offers no stdio. Put `mcp-remote` in front of the same URL, or use the **Remote · bearer** config block above. |
| `access denied: unknown agent`, `access denied: revoked` or `access denied: expired` | The key is not one Postern will resolve. [Why an agent was refused](/reference/refusals). |
## Next
`get_schema`, `query` and `get_record` — every parameter, every refusal.
`describe_context` and `fetch_live` — how old the data is, and how to refresh it.
`list_actions` and `invoke_action` — the write side.
Create a key and paste it into your agent.
# Read data: get_schema, query, get_record
Source: https://docs.getpostern.com/reference/mcp-reading
The three tools that read the local cache — every parameter, both response shapes, the traps that make a successful answer wrong, and every refusal by name.
**Before you start**
* **These three tools never leave the cache.** They read what Postern has already
synced. [`fetch_live`](/reference/mcp-freshness#fetch_live) is the one read that
touches a source.
* **`get_schema` is the contract `query` validates against.** Call it first. It is
filtered to your own grants, so it also tells you what you can reach.
* **A sector you were not granted is refused or filtered, depending on the tool.**
[Why an agent was refused](/reference/refusals).
Nothing on this page was captured from a run. The shapes are the declared types, and
the quoted strings are Postern's own.
## get\_schema
The queryable objects and fields, per sector — the contract `query` validates against.
A full object key (`finance.transaction`) returns that object. A bare sector name
(`finance`) returns every object in it. Omitted, it returns everything the key is
granted.
The answer is keyed by object key. Each entry is the object's declared shape:
```ts theme={"system"}
Record
fieldDocs?: Record
notes?: string
primaryTime?: string
jsonb?: string[]
serveDeduped?: boolean
}>
```
The ten object keys, and the sector each belongs to:
```text theme={"system"}
finance.account finance
finance.transaction finance
finance.holding finance
health.sample health
health.workout health
health.sleep_session health
mail mail
contacts contacts
calendar calendar
home home
```
A sector with more than one object takes the dotted key everywhere an object is named —
`query`, `get_record`, and `fetch_live` with an id. A sector with one object takes the
bare name.
This page does not repeat the field lists. Call `get_schema`: it is the authority, and
it is filtered to your own grants. Read `notes` and `fieldDocs` — they carry the sign
conventions, enums and unit traps that a field's type and name cannot.
These rules hold across every object:
| Rule | Detail |
| --------------------------- | --------------------------------------------------------------------------------------------------------- |
| `id` | Postern's own id for the row. `get_record` and `fetch_live` take this one. |
| `source_object_id` | The provider's own id. Not interchangeable with `id`. |
| Timestamps | ISO-8601 UTC. |
| `sum`, `avg`, `min`, `max` | Return precision-safe decimal **strings**. |
| `count` | Returns a number. |
| Rows the source has deleted | Excluded from `query`, still readable through `get_record`. |
| `raw` | The untouched copy of what the source sent. Its names, units and signs differ from the columns beside it. |
A sector the key was not granted comes back as an empty object, not a refusal.
`get_schema` filters to your grants after it resolves the name. So
`get_schema("finance")` on a key with no finance grant returns `{}`, which reads
like "this install has no finance data". An unknown name is different and does fail,
with `unknown sector: `. Read
[`describe_context`](/reference/mcp-freshness#describe_context) before you conclude
anything from an empty schema.
## query
A structured read over one sector, served from the local cache. There are no
cross-sector joins — fan out and correlate on your own side.
The object key. A sector with more than one object needs the dotted form.
Field-keyed conditions. A bare scalar means equality; a bare `null` means `IS NULL`.
Operators: `eq`, `neq`, `gt`, `gte`, `lt`, `lte`, `in`, `contains`.
The projected columns. Omitted, it is every flat field. At most 50 entries.
Capped at 500. In aggregate mode this caps groups instead of rows. Must be an integer
of 1 or more.
Rows mode only, capped at 5000. Deep paging is not supported — narrow with `where`.
Rows mode only. `dir` defaults to `asc`. At most 50 entries, no field twice.
`fn` is one of `count`, `sum`, `avg`, `min`, `max`. `count` takes no field; the other
four require a numeric one. `groupBy` takes up to 50 flat fields.
Finance objects only. See **Two banks, one row**, below.
```ts theme={"system"}
// rows mode
{ sector: string, object: string, count: number, has_more: boolean, rows: Record[] }
// aggregate mode
{
sector: string
object: string
aggregate: { fn: string, field?: string }
count: number
has_more: boolean
groups: { group: Record, value: number | string | null }[]
}
```
`count` is what **this response** holds. It is never a total, and never the answer to
"how many are there" — that is `aggregate: { fn: "count" }`. `has_more` comes from a
probe row rather than from `count === limit`, so a page that fills exactly reads
`has_more: false` truthfully.
Groups come back ordered by the aggregate value descending, then by the group columns
ascending. `count` there is a JSON number. `sum`, `avg`, `min` and `max` are decimal
strings, or `null` when the aggregated set was empty. Postern refuses `aggregate`
alongside `select`, `orderBy` or `offset`, and the refusal names the field.
Rows come back ordered by the object's `primaryTime` descending, with `id` ascending as
the tiebreak, unless you order them yourself. The order is deterministic within one
snapshot, but a later page can shift as a sync lands new rows.
Two clauses are on every query and are not yours to set: the read is scoped to the
owner's own rows, and rows the source has deleted are excluded. Those rows stay
readable through [get\_record](#get_record).
Operator detail that changes answers:
| Operator | Detail |
| --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `neq` | Null-inclusive — a row whose field is empty **does** match `neq: 'X'`. Ask for the field to be filled as well if you do not want those rows. `{neq: null}` means `IS NOT NULL`. |
| `in` | Up to 200 scalars. An empty array matches nothing. |
| `contains` | Substring match, text fields only, without regard to case. |
| `gt` `gte` `lt` `lte` | Refused on boolean fields. Cannot take `null`. |
**Project the untouched payload.** `select` may name a sector's raw columns as well
as its flat fields: `raw` on every object, plus `attendees` on `calendar` and
`attributes` on `home`. That reads a row and its untouched detail in one call, instead
of a `get_record` follow-up. Projection only — those columns stay out of `where`,
`orderBy`, `groupBy` and `aggregate`, which validate against the flat fields alone. It
is opt-in because `raw` costs a fetch and a decompress per row.
**Two banks, one row.** When the same account arrives through both SimpleFIN and Plaid,
Postern serves one merged row and hides the copies. In the Console that bank's row
carries *also arrives via SimpleFIN — served as one*. Both provider rows stay intact
underneath. `includeShadowed: true` reveals them, with read-only linkage columns
appended so a winner and its members can be tied together. Aggregates follow the same
rule, so that total double-counts a merged pair by design. On any sector but the three
finance objects the parameter is refused outright.
Money is signed, and negative means money **out**. To total spending, filter
`amount < 0` and negate the sum. A plain `sum(amount)` nets income against spending.
It is the single most common wrong answer this surface produces: it succeeds, it
returns a number, and the number is wrong. The per-field rule is in `get_schema`'s
`fieldDocs`.
### Four properties of finance data
Four more properties of finance data decide whether an answer is right. None is visible
from a field's type or name.
| Property | What it means for an answer |
| -------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
| SimpleFIN sends no categories | An absent category means *not categorised*. It never means *uncategorised spending*. |
| Investment positions are a snapshot | What is held now, not a stream of trades. No agent can derive gains or trade dates from them. |
| A cost basis of `0.00` | SimpleFIN saying it does not know, not saying the holding was free. Any return built on it is wrong, not approximate. |
| Plaid's history window is fixed at link time | Postern asks for up to two years, and it never widens. A query for an earlier period returns nothing; the remedy is to link the bank again. |
### What query refuses, by name
| Refusal | Cause |
| ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------- |
| `query requires a full object key (finance.account or finance.transaction or finance.holding), got 'finance'` | A multi-object sector named bare. The message lists the keys you can use. |
| `unknown sector: (known: …)` | A name that matches nothing. The message lists every known sector. |
| `unknown field in where: ` | A field that is not on that object. Call `get_schema` for the real list. |
| `limit must be an integer >= 1 (capped at 500)` | A `limit` of 0, a negative, a fraction, or text. |
| `includeShadowed is not valid on sector ""` | `includeShadowed` outside the three finance objects. |
A sector you were not granted is a different case. `query` and `get_record` are
refused before any database work, and the refusal names the sector rather than the
reason. [Why an agent was refused](/reference/refusals).
## get\_record
One stored record by id — the full row behind the tidy view.
The object key. A sector with more than one object needs the dotted form:
`finance.transaction`, not `finance`.
Postern's own id for the row — the `id` field in a `query` result, not the provider's
`source_object_id`.
Returns the stored row, or `null`.
This is the whole row as the database holds it. So it carries columns `query` never
projects, the untouched `raw` payload and the bookkeeping columns among them. It is
also the one read **not** filtered by deletion. A row with a non-null `deleted_at`
means the source has removed that object, and this is where you can still read it.
An id that is not a uuid returns `null` rather than failing, and so does a uuid naming
no row of the owner's. `null` is the absent answer here, not an error.
A bare multi-object sector does fail, with `get_record requires a full object key
(finance.account or finance.transaction or finance.holding), got 'finance'`.
## Next
How old the cache is, and the one read that leaves it.
The address, the transport, and what every tool call returns.
# The OAuth bridge, for hosted agents
Source: https://docs.getpostern.com/reference/oauth-bridge
Why a hosted agent cannot hold your agent key, how Postern signs it in instead, the eight addresses the internet reaches, and the one key it refuses.
**Before you start**
* **This page is about hosted agents only.** An AI app that runs on a company's
servers, like claude.ai or ChatGPT. It can never reach your home network on its
own. An agent on your own machine sends its agent key and needs none of this.
* **The bridge is on exactly when Postern has a public address.** There is no
separate switch. [Set up remote access](/start/remote-access) is the procedure.
* **A key that never expires is refused here.** Create or rotate one with an expiry
first. [Agent keys](/reference/agent-keys#expiry).
An agent on the same machine as Postern sends its agent key on every call. A hosted
agent — claude.ai or ChatGPT, running on a company's servers — cannot, because those
services will not take a fixed key.
So Postern ships a small OAuth 2.1 sign-in server on the agent port. Your agent signs
in to Postern's own sign-in page, pastes the agent key there once, and holds a token
that rotates from then on. That token resolves to the same grant row the key does: the
same sectors, the same expiry ceiling, the same revocation, and the same name in the
record. A chain of refreshes can never outlive the key's own expiry. Revoke the agent
and every token made from it dies with it.
Nothing on this page was captured from a run. The quoted strings are Postern's own.
## Turning the bridge on
The bridge is on exactly when Postern has a public address. There is no separate switch,
and while it is off its paths answer 404 like any other path that is not `/mcp`.
To turn it on:
1. In the Console, click **Settings**.
2. Find the **Remote access** band.
3. Type your address into **Your gate’s public address**.
4. Click **Publish this gate**.
5. Restart Postern.
[Set up remote access](/start/remote-access) is the whole procedure. Nothing is
published by default.
### Save the origin only
**Save the origin only.** Postern refuses an address carrying a path, a query, a
fragment, or a username and password. It serves every address it publishes at the root,
so a saved path would send agents to an address that answers nothing — while the boot
log, both discovery documents and the Console's own indicator all still read correctly.
That is why Postern refuses one, and the refusal names the origin to save instead. A
port is fine: Postern drops a default port, so `https://host.ts.net:443` is stored as
`https://host.ts.net`, and a non-default port such as `:10000` is legal.
An agent needs that address **plus `/mcp`**. The Console appends the suffix itself, in
one place, so its **Copy** button is the right source for the string.
## What the internet reaches
With the bridge on, the internet reaches exactly eight addresses on one port:
| Address | What it holds |
| --------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `GET /.well-known/oauth-protected-resource`
`GET /.well-known/oauth-protected-resource/mcp`
`GET /.well-known/oauth-authorization-server` | Three sign-in documents. No data of yours. |
| `GET /authorize` | The sign-in page. |
| `POST /authorize` | The sign-in itself. Your agent key gates it. |
| `POST /token` | The token exchange. |
| `POST /register` | Registers a **client application**, never an agent. Anyone who can reach the address may call it, the OAuth standard requires that, and a registration on its own reaches no data of yours. Rate-limited. |
| `POST GET DELETE /mcp` | Your data. Needs a key. |
**The Console is not among them.** Nothing else on the machine is reachable.
| The sign-in document advertises | Value |
| ------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
| Response types | `code` |
| Grant types | `authorization_code`, `refresh_token` |
| Challenge method | `S256` only — Postern refuses a sign-in that offers anything else, or none, with `code_challenge_method must be 'S256' (plain is not accepted)` |
| Token endpoint auth | `none` — registration is dynamic, and there is no client secret |
| Access token | prefix `pcgat_`, lives 3600 seconds |
| Refresh token | rotates on use; reusing a rotated-out one revokes the whole chain |
With the bridge on, a 401 also carries a `WWW-Authenticate` challenge pointing at the
protected-resource document. With it off, a 401 carries no such header.
## A hosted agent key must carry an expiry
claude.ai and ChatGPT refuse an agent key that never expires. Postern's own bridge
enforces that too, and says so in different words from a bad-key refusal:
```text theme={"system"}
This agent key never expires. Keys used with a cloud client must have an expiry —
mint or rotate a key with a 30/90/365-day expiry in the Console, then try again.
```
The bridge enforces that rule at the authorize step, and nothing else does. Nothing at
creation time stops a key that never expires, because the route that creates a key
cannot tell a cloud key from a local one — Postern cannot know then that the key will
go to someone else's cloud. Nothing at token refresh enforces it either, because a
check there would kill every connected session on deploy. So the bridge refuses a key
you created before you had a public address, at the sign-in and not earlier. A key that
never expires, held by a company's cloud, ends only when you notice it.
The Console itself never blocks such a key. It only moves the default and states the
reason.
That message names a 365-day expiry. The Console offers only **Never**,
**30 days**, **60 days** and **90 days**. The mismatch is a product defect, not
an instruction. Pick **30 days** or **90 days**.
## Anyone can register a client
The bridge accepts a client registration from anyone who can reach your public
address. The OAuth standard requires that, so Postern cannot refuse one on the
strength of who sent it. A registration on its own reaches no data of yours.
So the client name and the destination on the sign-in page are your only check that
the request came from the application you started. Approval sends a one-time code to
that destination. That is why Postern prints both lines above the key box, and why
neither is a setting.
## Hosted agents connect out on port 443 only
Say a hosted agent reports it could not reach you, and nothing at all appears in your
logs. It never arrived. That company's network resets an address on any other port
before the request leaves it. The absent log line is evidence about the port, not about
Postern. A hosted agent then remembers the failed check for a few minutes, so an
immediate retry reads the cached failure rather than testing your fix. Wait five
minutes, then try once.
## If something went wrong
| What you see | What to do |
| ---------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
| A hosted agent says it could not reach you, and nothing appears in your logs | Nothing arrived. Move the address to port 443, wait five minutes, then try once. |
| `This agent key never expires…` on the sign-in page | Create or rotate a key with an expiry, then sign in again. [Revoking, rotating and removing](/reference/agent-keys#revoking-rotating-and-removing). |
| `code_challenge_method must be 'S256' (plain is not accepted)` | The client offered a weaker challenge. Postern accepts `S256` and nothing else. |
| 404 on `/authorize` or `/register` | The bridge is off, because Postern has no public address. [Set up remote access](/start/remote-access). |
| The sign-in page names an application you did not start | Do not approve it. The name and the destination are the check. |
## Next
Give Postern a public address, so a hosted agent can reach it.
The longest of the hosted paths, walked end to end.
# Which computers can reach Postern
Source: https://docs.getpostern.com/reference/ports
The two ports Postern opens, the one line in docker-compose.yml that protects them, what guards each route group, and the one route the internet may reach.
**Before you start**
* **Postern opens two ports, and it opens both to this computer only.** Only
this computer can reach these addresses. Nothing on your Wi-Fi, and nothing on
the internet, can.
* **The Console port has no password.** Which computers can reach it is the
whole of its protection.
* **The protection is one line in `docker-compose.yml`.** Both `ports:` lines
for the `app` service must begin `127.0.0.1:`.
* **One route is meant to be reachable from outside.** The push-ingest route,
and it carries its own secret.
## The two ports, and the one Postern never opens
| Port | Carries | Reachable from | What protects it |
| ----------------------- | -------------------------------------------------------------------------------------------- | --------------------------------------------------- | ----------------------------- |
| 8787 — the Console port | the Console, the admin routes, the OAuth and Plaid routes, the audit read, the export, erase | this computer only | its address, and nothing else |
| 8788 — the agent port | the tools an agent calls over MCP | this computer only, until you turn on remote access | an agent key on every call |
| Postgres | your synced rows | Postern only | it is not opened at all |
The database gets no port in the compose file Postern ships. Only Postern reaches
it, over the private network Docker Compose creates. A port there would buy you
`psql -h localhost` and cost you a listener that holds every row Postern has
cached. If you need one to inspect the data, add it temporarily and keep it on
this computer: `ports: ["127.0.0.1:5432:5432"]`. Postern serves the Console, the
Console's backend and the agent port from one address.
## The Console has no authentication
Port 8787 serves the Console and the admin routes together. Three of those routes
matter most: onboarding, credential paste, and the route that creates an agent
key. The group carries no key, no password and no session.
The `ports:` line in `docker-compose.yml` is what protects it. Open that file in
the folder you unpacked, find the `app` service, and look under `ports:`. Both
lines must begin `127.0.0.1:`.
Never drop the `127.0.0.1:` prefix, and never put a tunnel service in front of
that port. Without the prefix the port answers on every network interface. On
Linux, Docker's rules sit ahead of most host firewall rules, so `ufw deny 8787`
does not close it again. No supported configuration makes that port safe on a
network.
```yaml theme={"system"}
ports:
- "127.0.0.1:${REST_PORT:-8787}:${REST_PORT:-8787}" # correct — this computer only
- "${REST_PORT:-8787}:${REST_PORT:-8787}" # WRONG — your whole network
```
A `Host` check sits in front of those routes: `localhost`, `127.0.0.1`, `::1`,
plus anything you add to `REST_ALLOWED_HOSTS` in `.env`. It checks the address
your browser used, and it stops a malicious web page that tries to reach Postern
through your own browser.
It is not a password. The `Host` header is a string the caller chooses, so it
identifies nobody. Anyone who can open a connection to that port can send
`Host: localhost:8787` and create an agent key in one request. That request needs
no credential, and the key comes back in the answer. `REST_ALLOWED_HOSTS` only
widens which `Host` values Postern accepts, so it cannot make the port safe. Add a
tailnet name to it and every admin route opens to every device on your tailnet.
To reach the Console from another computer, leave the `ports:` line alone. Put
something that authenticates in front of it. It has to land on this computer: an
SSH tunnel, `tailscale serve`, or a reverse proxy that authenticates first.
[Set up remote access](/start/remote-access) is the procedure for each.
A tunnel does not move the Console. Your browser connects to your own computer.
SSH carries that connection to the machine Postern runs on, and it arrives from
the machine itself — the only kind of request Postern answers. The port stays
local and the tunnel carries the identity.
The rule is per route, not per port. Four other route groups share port 8787, and
Postern protects each one differently.
| Route group on 8787 | What protects it |
| --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
| the admin, OAuth and Plaid routes | nothing but the address |
| the REST read mirror | an agent key on every request |
| `/healthz` | nothing, deliberately, so a container check can reach it — it returns only a status |
| `/api/export` | nothing but the address. The bundle is the whole store, and no agent's grant narrows it, so its reachability is the only thing that bounds it |
| `POST /api/ingest/:connectionId` | a per-connection secret, described below |
## The agent port authenticates every call
Port 8788 is the agent port. MCP is the standard way AI assistants connect to
outside tools. Postern speaks it, so Claude, ChatGPT and Cursor connect the same
way. Every call carries a per-agent key in an `Authorization: Bearer` header, and
Postern resolves it to a grant before anything runs. Postern refuses a missing,
unknown or revoked key at the handshake, before any tool exists to call.
Port 8788 is opened to this computer only. To let an agent reach it from
elsewhere, go to Console → **Settings** → **Remote access**. Do not edit the
`ports:` line.
A grant is the sector list attached to one agent's key. A sector is one area of
your life: finance, mail, calendar, contacts, health, home. It is the smallest
thing you can grant. A new key can reach nothing until you tick a sector.
Postern denies an ungranted sector before it issues any SQL. It also refuses a
target whose first word is not one of the six, rather than map it onto a sector
you did grant.
A granted sector covers reads and actions together. Today only home has anything
to act on. [What a grant covers](/reference/grants-and-sectors#what-a-grant-covers)
is the full model.
## There is no rate limit and no lockout
A wrong key costs the sender nothing, on the agent port or on the REST read
mirror. Nothing counts failures, nothing locks out an agent or an address, and
nothing slows the next attempt. The defence is the 256 bits of randomness in the
key. There is no second layer behind it.
Postern records refused keys rather than drops them silently. The agent port
writes a deny line for every key a caller presents and Postern refuses. The cap
is 30 a minute, and one combined line stands in for whatever the cap swallowed. A
caller that presents no key at all leaves no line, unless the OAuth bridge is on.
The REST read mirror records no refused key at all —
[what does not get a row](/reference/audit-log#what-does-not-get-a-row) has the
split.
Postern has exactly one rate limiter and it is not here. It sits on the OAuth
bridge's own routes — registration, authorize, token — at 120 requests a minute.
Postern sized it for availability, not for defence.
Behind a Tailscale Funnel there is no client address to count against. The tunnel
lands locally and Docker rewrites every connection to one source, so a per-caller
limit becomes one global limit for the whole internet. `MCP_TRUSTED_PROXIES` in
`.env` changes that only when you run your own proxy in front, and only when that
proxy supplies a real client address. Leave it unset otherwise.
The cost is narrow: a stranger who finds your address can disrupt connection
setup. That exposes no data and puts no key at risk, and every read and action
still needs a key.
## The push-ingest route
`POST /api/ingest/:connectionId` sits outside the `Host` check on purpose. The
device that pushes to it is a phone, and a phone is never the machine Postern
runs on. So whatever address you put in front of the path works. Three route
groups on 8787 carry no `Host` check: this one, `/healthz`, and the agent read
mirror. This is the only one of the three with neither the check nor a key.
A per-connection secret stands in for both. It is 32 random bytes, made the same
way an agent key is, and stored only as its SHA-256. A device sends it in either
an `Authorization: Bearer` header or an `X-PCI-Webhook-Secret` header. The Console
shows it once when it creates it. Postern cannot show you this secret again — not
the connection screen, not the log, not the database. If you lose it, press
**Rotate secret** on the connection. That creates a new one, and it stops every
device that still sends the old one.
Four properties make an internet-reachable route acceptable here:
* **Postern checks the secret before it reads the body.** Send a bad secret with
a huge or malformed payload and Postern refuses it. It never holds that payload
and never parses it.
* **The comparison takes the same time whether the secret is right or wrong**, so
a guesser learns nothing from the speed of the answer. Postern compares two
32-byte digests, never two strings. A stored hash of the wrong length fails
closed rather than throws.
* **Every failure answers identically.** Five causes all return the same `401` and
the same body, `{"error":"unauthorized"}`. They are an unknown connection id, a
paused connection, a connection with no secret set, a wrong secret, and a
malformed id. Nobody can use the route to learn what exists. That is also why a
stuck device tells you nothing: the answer is in the record, on the machine
Postern runs on.
* **Ownership comes from the connection row, never from the payload.** Postern
reads the user, the sector and the destination table from the database, against
the id in the path. A pusher cannot choose whose account its records land in, or
which table.
The exemption unguards nothing else. The admin, OAuth and Plaid routes stay
behind the `Host` check.
## What Postern connects out to
Postern pulls from your sources. No source has to reach the machine Postern runs
on, and Postern opens no port for one. The push-ingest route above is the
exception.
Behind a strict outbound firewall, iCloud needs `*.icloud.com` and
`imap.mail.me.com:993`. A fixed list of hostnames is not enough. Apple spreads
accounts across partition hosts, and Postern follows Apple's own discovery onto
`p##-caldav.icloud.com` and `p##-contacts.icloud.com`, where `##` is your
account's partition. Postern re-discovers that host on every call and stores none.
Postern checks every request address against `*.icloud.com` before it attaches
the app-specific password. That covers Apple's internal discovery hops too. It
takes redirects one at a time, and it refuses any redirect that leaves
`*.icloud.com` rather than send the password again. Postern requires HTTPS and
refuses a downgrade to HTTP.
## Reaching Postern from another network
Your tailnet is the private network Tailscale builds between the devices signed
into your account. Nothing else can reach it. Postern documents Tailscale and
nothing else, for four reasons:
* Tailscale encrypts it end to end;
* it needs no port forwarded on your router;
* it works on internet connections that block traffic from outside;
* the certificate keys never leave the machine Postern runs on.
Postern documents no content-delivery-network route on purpose. A CDN in front of
Postern decrypts every request at its own edge. That would put your mail and your
money in readable form on somebody else's network.
| Fact | What it costs you |
| ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| A Tailscale Funnel opens exactly three ports: 443, 8443 and 10000. A hosted agent makes outgoing connections on 443 only. | Use 443. A funnel on either other port never gets the request out of the vendor's network, so the agent reports it could not connect and nothing at all appears in your record. |
| `serve` and `funnel` are last-command-wins per port. | Scope the funnel permission to one machine's tag in your tailnet policy. If every machine holds it, a mistyped command on any of them can make something reachable from the internet. |
| A public address is permanent in a certificate log. | Certificate Transparency is a public list of every secure-website certificate ever issued. Anyone can read it, and entries cannot be removed. |
Three costs stay with you: that permanent hostname, a Tailscale account to keep,
and an address that stays live until you turn it off.
[Set up remote access](/start/remote-access) is the procedure.
## Confirm it works
* Both `ports:` lines for the `app` service in `docker-compose.yml` begin
`127.0.0.1:`.
* On the machine Postern runs on,
`curl -s -o /dev/null -w "%{http_code}" http://127.0.0.1:8787/healthz` prints
`200`.
* From another computer on your network, the same command with that machine's LAN
address in place of `127.0.0.1` fails to connect.
* Console → **Agents & keys** lists every key that can reach port 8788, and no
others.
## If something went wrong
| What you see | What to do |
| ------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| A push to `/api/ingest/…` returns `401` and `{"error":"unauthorized"}` | Every cause answers the same way, so check all four: wrong secret, wrong connection id, paused connection, no secret set. Press **Rotate secret** on the connection and re-enter the new secret on the device. |
| The Console answers from another computer on your network | A `ports:` line has lost its `127.0.0.1:` prefix. Put it back and run `docker compose up -d app`. A host firewall rule will not close it for you. |
| A hosted agent reports it could not connect, and nothing appears in your record | The funnel is on 8443 or 10000. A hosted agent connects out on 443 only. |
## What you have now
Two ports, both opened to this computer only, and a database with no port at all.
The Console port's protection is its address, so anything that widens which
computers can reach it removes the protection entirely. The agent port asks for a
key on every call. One route — push-ingest — is meant to be reachable from
outside, and it carries its own secret.
## Next
Tailscale + optional Funnel · about 20 minutes, once · off by default
what a key is, when it dies, and the four operator verbs
# Provider sign-ins
Source: https://docs.getpostern.com/reference/provider-sign-ins
The redirect address Postern pins, what each provider needs and why, why the failures say so little, and the credentials that behave like passwords.
**Before you start**
* **Copy the redirect address from your own Console, never from a page.**
Postern composes it from its own port, and providers match it character for
character.
* **Postern encrypts every client secret on your machine.** A secret leaves it
for one purpose only: the request that renews the sign-in.
* **Three of the credentials you paste behave like passwords.** An Apple ID
password, a SimpleFIN access URL and a SimpleFIN setup token.
* **The failure messages are deliberately thin.** That is a decision about
where credentials can end up, not a bug.
Every source page — [Google](/connect/google), [Microsoft](/connect/microsoft),
[WHOOP](/connect/whoop), [iCloud](/connect/icloud), [Plaid](/connect/plaid),
[SimpleFIN](/connect/simplefin) — carries the clicks for that provider. This page
carries what is true across all of them.
## The redirect address is pinned inside Postern
Postern composes the redirect address from its own port, in one place. On a stock
install it is `http://localhost:8787/api/oauth//callback`. Postern never
derives it from the address you reached the Console at, and never from the inbound
`Host` header.
The Console asks Postern which address Postern will send, and prints that answer
exactly. So a Console that cannot reach Postern prints nothing rather than a
guess. Providers match the string character for character, which is why you copy
it from your own Console and never from this page. It stays true if you move the
Console off port 8787.
It says `localhost` rather than `127.0.0.1` on purpose.
Microsoft's portal refuses an `http://` address with an IP number in the field
beside the platform dropdown, and it accepts any port after `localhost`. Google
accepts both forms. WHOOP is proven on `localhost`.
Postern holds an unfinished sign-in in memory for 10 minutes and spends it on
first use. It writes nothing about that sign-in to disk. If you wander off
mid-consent, restart Postern, or reload the callback address, the sign-in ends and
the browser shows `{"error":"invalid or expired state"}`. Postern stored nothing,
and nothing is broken. Start again from the Console. The same hold governs Google,
Microsoft and WHOOP.
## What each provider needs, and why
| Provider | Client secret | The security fact behind it |
| --------- | ----------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Google | required | Google issues a confidential client, and Postern sends the secret only to Google, only to ask for fresh access. Postern asks for no Gmail permission, ever: the Gmail API needs restricted scopes, and restricted scopes mean an annual third-party CASA assessment for every self-hosted install. Mail comes in over IMAP with an app password instead. Postern locks Google's scopes to `calendar.readonly` and `contacts.readonly`, and a product test asserts that no Gmail scope can appear in the sign-in address. |
| WHOOP | required | WHOOP offers no app type that can prove itself without a secret, so the secret is the only proof the request is your app. WHOOP renews a sign-in only when the refresh request carries `scope=offline`. A consent without it works today and is dead tomorrow. |
| Microsoft | never created, stored or sent | Microsoft lets Postern prove itself without a secret, so Postern never creates one. The Console disables its **Client secret** field, and that field reads `not required — public client (PKCE)`. Postern rejects a secret sent for such an app. Unlike Google there is also no API to switch on, and no permission to add in Entra ahead of time: Postern asks for its read permissions at sign-in, and Microsoft's consent screen is where you grant them. |
| Plaid | a client ID and a Production secret | Postern pastes these into Plaid. There is no redirect address to register with Plaid at all. |
| SimpleFIN | none | You claim a setup token once, for an access URL. |
| iCloud | none | An app-specific password. |
Postern encrypts every client secret into the vault on your machine. A secret
leaves that machine for one purpose only: the request that renews the sign-in.
Postern never sends it to a browser and never renders it back into the Console.
[What else is in the vault](/reference/vault).
## Two Microsoft registration choices Postern cannot work around
* **Supported account types.** Postern starts every Microsoft sign-in at
Microsoft's `common` address, the one address that serves personal and
organisational accounts alike. An app registered for a single directory refuses
a sign-in that arrives there. The **Supported account types** dropdown opens on
**Single tenant only - Default Directory**, which cannot sign in a personal
Outlook or Hotmail address. **Any Entra ID Tenant + Personal Microsoft
accounts** is the one row that covers personal, work and school together.
* **Platform type.** Entra's **Single-page application (SPA)** platform caps
refresh tokens at 24 hours. Postern refreshes the sign-in silently, but a
24-hour token runs out inside a day and Microsoft demands a new interactive
sign-in. No Postern setting changes it. **Public client/native (mobile &
desktop)** gets Microsoft's 90-day rolling refresh instead.
## Why provider failures say so little
| Source | What you see | Why |
| --------- | ---------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| WHOOP | the provider's own error code, unchanged | It is the thing you match against your registration, so Postern never rewrites it. |
| iCloud | `icloud-mail: sync failed`, `apple: DAV connect failed`, `apple: DAV account discovery failed` | These name the stage the run reached, never the cause. The app-specific password travels on every request to Apple, so any reply echoed into an error could carry it into a log. The cause is nearly always the credential. |
| SimpleFIN | `SimpleFIN refused it.` with `simplefin setup-token claim failed` underneath | The same pair for every cause. Postern refuses to put any part of a credential into an error string, so a screenshot of a failed connect carries no secret. |
### A refused source credential is not retried
Home Assistant throttles repeated sign-in failures, so Postern treats
`auth failed: invalid token` as final. Only a new token or a new address brings
that connection back. No timer will.
## Three credentials that behave like passwords
| Credential | What to know |
| --------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **An Apple ID password** | Postern does not check which iCloud credential you paste. It encrypts whatever you give it and stores it, so an Apple ID password ends up on the machine Postern runs on and then fails anyway. Apple refuses an Apple ID password for mail, calendar and contacts on an account with two-factor authentication on. Only an app-specific password works. The failure arrives at the first sync, not at the paste, because the paste never contacts Apple. |
| **A SimpleFIN access URL** | It carries a username and a password inside its own text. Anyone who holds that line can read every bank linked at the Bridge, with no further sign-in. Postern encrypts it, never shows it back, never echoes it in an answer, and never writes it to a log. If you pasted an access URL rather than a setup token, delete the copy in your clipboard and in your notes. |
| **A SimpleFIN setup token** | Not a credential Postern keeps — a one-time voucher. Postern base64-decodes it into the claim address the Bridge put inside it, requires `https://`, and posts to it once. The Bridge answers with an access URL, which Postern encrypts; Postern never writes the setup token to disk. You can use a setup token one time. Once Postern claims one it is spent everywhere, in Postern and in every other SimpleFIN client. The remedy is a fresh one: at the Bridge, open **My account**, press **New app connection**, then press **Create Setup Token**. A failed claim writes no row, because Postern claims before it inserts the connection — so you can paste again with nothing to clean up. |
## Plaid never shows Postern your bank sign-in
Plaid's hosted Link is why you can link a bank from a Postern that nothing on the
internet can reach. You sign in to your bank on a page Plaid hosts, in a tab
Postern opened but does not read. The Console picks the result up by a check on
the session every few seconds. Postern never receives a call back from Plaid, so
it opens no port to the internet and there is no redirect address to register.
What returns is an access token for that one bank, which Postern encrypts and
stores. Postern never held the bank password.
One Link session carries one bank. A multi-bank session needs a Plaid user token,
and Plaid issues one only to apps enrolled in products Postern does not use. The
Console's panel still says *bank(s)* because that is Plaid's own wording, not a
promise Postern can keep. For each further bank, open a new session from the
**Plaid** group header's **Add a bank** link.
## Confirm it works
* The redirect address you registered with the provider is the string your own
Console printed, character for character.
* Console → **Sources** shows the connection, and the connection reads `ok`
rather than an error naming a stage.
* For Google, one sign-in has produced two connections; for Microsoft, three.
* The **Client secret** field for Microsoft is disabled and reads
`not required — public client (PKCE)`.
## If something went wrong
| What you see | What to do |
| ----------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `{"error":"invalid or expired state"}` in the browser | The sign-in ran past its 10 minutes, or Postern restarted mid-consent. Nothing was stored and nothing is broken. Start again from the Console. |
| An iCloud connection fails at the first sync, not at the paste | The paste never contacts Apple, so a wrong credential can only fail later. Only an app-specific password works on an account with two-factor authentication on. |
| `SimpleFIN refused it.` with `simplefin setup-token claim failed` | The same pair covers every cause, and a spent token is the usual one. Get a fresh setup token at the Bridge: **My account** → **New app connection** → **Create Setup Token**. Nothing needs cleaning up first. |
| A Home Assistant connection stays down after you fixed the token | Postern treats `auth failed: invalid token` as final and never retries it. Paste the new token, or the new address, on the connection itself. |
## What you have now
One redirect address, pinned inside Postern and copied out of your own Console.
Each provider's client secret encrypted on your machine, leaving it only to renew
its own sign-in. And a set of failure messages that tell you the stage rather than
the cause, on purpose.
## Next
what is encrypted, where the key lives, and what destroys it
which sectors a sign-in turns on, and what one grant covers
# Read the record
Source: https://docs.getpostern.com/reference/read-the-record
The ledger screen and GET /api/audit — the columns, every filter, paging, and Export CSV.
**Before you start**
* **You can read this only on the machine Postern runs on.** From your own
computer, forward the port first, then open `http://localhost:8787`:
```bash theme={"system"}
ssh -L 8787:localhost:8787 you@the-machine
```
* **You need no agent key.** Whether you can reach this computer is the whole of
the authorization.
Two surfaces read the same rows: **The ledger** in the Console, and
`GET /api/audit` on the Console port. Both serve the same history, newest first.
[What one row holds](/reference/audit-log#what-one-row-holds) names every column
and what it means.
## Read it in the Console
Click **The ledger** in the left nav. The table has six columns: **Time**, **Who**,
**Tool**, **Sector**, **Args**, **Decision**. Click any row to open the **Ledger
entry** panel — Time, Agent, Tool, Sector, Decision, Deny reason, Outcome, Result
count, Request id and **Args (redacted, verbatim)**. Press **Close** or `Esc` to
dismiss it.
The **Decision** column shows only refusals and errors. Open a row to see its
state in full.
| Control | Options |
| -------------------- | --------------------------------------------------------------------- |
| **Filter by agent** | **All agents**, then one per agent |
| **Filter by tool** | **All tools**, then one per tool |
| **Filter by sector** | **All sectors**, then one per sector |
| **Since** | **Any date** · **Last 24 hours** · **Last 7 days** · **Last 30 days** |
| The decision toggle | **All** · **Admitted** · **Denied** |
There is no filter for errored calls. The API accepts no filter on `outcome`.
**A sector filter is not a narrower view of the whole record.** It is an equality
match on the `sector` column, and SQL equality never matches null. Every call
that happened in no sector leaves the view — an agent that asks what Postern
holds, a refused handshake. Those calls are still recorded. The Console says so
under the control the moment you set one.
One page is 100 rows. **Load more ↓** walks older pages with the cursor Postern
creates. The view can reach the true end of history, and it says so when it does.
**Export CSV** takes the rows currently loaded and nothing else. Its column names
match the API's field names, not the table headers. Values that look like
spreadsheet formulas get a leading apostrophe, so they cannot run when you open
the file.
## Read it over HTTP
`GET /api/audit` serves the same pages as JSON, on the Console port. Open a
terminal **on the machine Postern runs on** and run:
```bash theme={"system"}
curl -sD - "http://localhost:8787/api/audit?limit=5"
```
`-s` hides the progress meter; `-D -` prints the response headers, where the
paging values live. A working call prints `HTTP/1.1 200 OK`, the headers, then a
JSON array of up to 5 rows, newest first. There is no envelope and no total.
`8787` is the Console port on a stock install. `REST_PORT` in `.env` moves it and
this endpoint follows. `.env` sits beside `docker-compose.yml`; edit it there, not
in the Console, then run `docker compose up -d`.
From any other computer this call fails, and that is correct. Compose opens the
port to this computer only. Postern also refuses any request whose `Host` header
is not `localhost`, `127.0.0.1` or `::1`, with `403` and
`{"error":"forbidden host"}`.
### Filters
Every filter is optional, and every value is a bind parameter.
Exact match on `agent_id`.
Exact match on `tool`.
`allow` or `deny`.
Exact match, verbatim. Postern never checks it against the registry, because the
record is history: a sector that no longer exists returns its rows rather than an
error. Excludes every row whose sector is null.
An ISO timestamp. Returns rows at or after it. A value that does not parse is a
400\.
The cursor for the next page. Send back the previous response's
`x-postern-audit-next` header exactly as you received it. **Never build your own
from a row's `created_at`.** The wire timestamp has lost the microseconds the
cursor needs, so a rebuilt cursor silently skips rows. Batch inserts make those
neighbours common. A bad value is a 400:
`invalid 'before' cursor: echo the previous page's x-postern-audit-next header value unmodified`.
Capped at 1000 without complaint — a larger request returns the ceiling, not an
error. Anything that is not a positive whole number (`0`, `-1`, `abc`, `1.5`) is
a 400 with `invalid 'limit'`. This bounds one page, not what is reachable.
### The served row
Every column of the table, minus `user_id`: `id`, `agent_id`, `tool`, `sector`,
`decision`, `deny_reason`, `args`, `result_count`, `outcome`, `request_id`,
`created_at`. [What one row holds](/reference/audit-log#what-one-row-holds) gives
each one its meaning.
Two differences from the table. `id` is a `bigserial` in the database and a string
on the wire. `created_at` is ISO text at millisecond precision, so the cursor's
microseconds are not in it.
`user_id` is never served. There is one user on a self-hosted Postern, and the
route scopes every query to them.
### Paging headers
* `x-postern-audit-has-more` — `true` or `false` on every 200. `false` means this
is the last page. Postern fetches one row past your `limit` and trims it, so a
page that fills exactly still reports `false` truthfully.
* `x-postern-audit-next` — the cursor for the next page, present when has-more is
`true`.
An **absent** has-more header is not `false`. Absent means Postern did not answer
the question. Treat it as unknown, never as the end of the record.
## Confirm it works
* Console → **The ledger** shows at least one row, or the empty state
`Nothing has come through the gate yet. Every read and action will be recorded here.`
* Send a connected agent a message such as *"What can you see in Postern?"*. With
**Filter by sector** on **All sectors**, a row appears within about 2 seconds,
with the agent's name under **Who** and `describe_context` under **Tool**.
* Pause a connection or run a sync. A row appears with `operator` under **Who**.
* Point an agent at Postern with a key it does not know, then restart that agent.
The client fails to connect, and a row appears with **Denied** under **Decision**.
## If something went wrong
| What you see | What to do |
| ------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| The record is empty, or a row is missing or a second late | `created_at` is the insert time and Postern flushes every 1000 ms — wait 2 seconds and reload. If it never arrives, check the container log for `[audit] queue overflow — dropped` or `[audit] flush failed, dropped batch:`. Both mean rows were dropped and never retried. Reduce the call rate; there is nothing to recover. [How durable the record is](/reference/record-limits#how-durable-the-record-is). |
| A sector filter hides calls you know happened | Set **Filter by sector** back to **All sectors**. It never matches a call that happened in no sector, which is exactly what `describe_context` and refused handshakes are. |
| You read your own data in the Console and no row appeared | Correct, not a failure. Postern does not record reads you make yourself, nor any of the six Console acts that leave no row. [What does not get a row](/reference/audit-log#what-does-not-get-a-row). |
| `invalid 'before' cursor: …` or `{"error":"forbidden host"}` | For the cursor, paste the previous response's `x-postern-audit-next` header exactly, with nothing rebuilt or trimmed. For the 403, run `curl` on the machine Postern runs on — the port is opened to that computer only. |
## Next
what one row holds, what gets a row, and what does not
what is dropped before it lands, and what nothing in the database prevents
# What the record cannot promise
Source: https://docs.getpostern.com/reference/record-limits
How durable the record is, why nothing enforces immutability, and the five questions the record cannot answer.
Three limits, and none of them is a setting you can change. Entries can be dropped
before they reach the table. Nothing in the database stops a row from being changed
or deleted. And five questions the record was never able to answer.
[The audit log](/reference/audit-log) carries what a row holds and what earns one.
This page is how far that record can be trusted.
## How durable the record is
Postern writes the record in the background, so the write never slows an agent
down and a dead database cannot break a read. The defaults: flush every 1000 ms or
at 100 buffered entries; 100 entries per insert; a queue that holds 10,000; at most
one insert in flight.
Three things stop an entry before it reaches the table.
| What happened | What you see | What it costs |
| ----------------- | ----------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- |
| The queue is full | `[audit] queue overflow — dropped` in the container log, with a running total | The **incoming** entry is refused, never the oldest, so a flood cannot erase history already queued |
| An insert failed | `[audit] flush failed, dropped batch:` and the reason on stderr | The batch was already off the queue, so it is dropped rather than retried. Postern does not crash |
| A hard crash | Nothing | Whatever was buffered goes with it. A clean shutdown drains the rest, best-effort |
Every count you take off this record is a **lower bound**, and what it lost is
gone. There is no retry, no spool, and no marker to say something was dropped.
That direction is safe for *is this key quiet enough to revoke?*, where a dropped
line can only make a key look quieter. It is unsafe for the opposite question. An
empty result is not evidence that an agent never read a sector. Under a sustained
flood the record goes blind forward rather than loses its past. The refusal caps
are what keep that out of an anonymous caller's reach.
## Nothing enforces immutability
Postern only ever adds to the record. Append-only in practice: the only statement
the code runs against `audit_log` is an insert. Nothing updates or deletes a row.
* **An erase keeps the record.** Erase is a real hard delete and touches
domain rows only. The record of the act survives the act, and never held the
values.
* **A revoked agent keeps its rows.** `agent_id` is plain text with no foreign
key, so the history does not go with the grant.
* **Nothing ages out.** There is no retention job in the repository.
The database does not prevent a row from being changed or deleted. Postern
connects as the account that owns the table, and that account may change or
delete rows. Postern never does, but nothing stops it. Anyone who can reach
Postgres can rewrite the record, and the record cannot tell you that they did.
`db/schema.sql` carries a comment saying `UPDATE` and `DELETE` are revoked from
the app role. No such change exists in the schema or in any migration. Read it as
intent, not as a control.
[Where that sits in the trust boundary](/reference/security-model#the-trust-boundary).
Immutability here is yours to provide, with your Postgres roles, backups and disk.
A writer role that does not own the table, an append-only replica, rows shipped off
the machine as they land — Postern does none of that for you today.
## What the record cannot tell you
* **Whether it is complete.** Nothing in a row says an entry is missing.
* **How many entries exist.** No total, no count endpoint. A filtered-empty view
can say whether older pages exist, and nothing more.
* **Which key made a call, after a rotation.** `agent_id` is a name, not a key
identity. A new key under the same name inherits the earlier key's history.
* **What a read returned.** Only how many rows.
* **Anything about a call that was never made.** That cuts the useful way too.
An agent that claims work it never did leaves no row for it. Witnessed on
ChatGPT — 50 seconds of progress text, an answer that said it had no data, and 0
calls recorded. Trust the record over the answer.
## Next
what one row holds, what gets a row, and what does not
the ledger screen and `GET /api/audit` — filters, paging, and Export CSV
# Why an agent was refused
Source: https://docs.getpostern.com/reference/refusals
Where the sector check happens, the two refusal shapes on each surface, the three reasons a key itself fails, and which refusals leave a row.
**Before you start**
* **Two different things say no.** Either the key failed, or the key was fine
and the sector was not granted. The wording, and the record, differ.
* **The surface changes the answer.** The REST read mirror on the Console port
and the agent port answer the same refusal in opposite shapes.
* **Read the agent's own status first.** Click **Agents & keys**, click the
agent, and look at its line and its lit toggles.
## Where the check happens
Every read goes through one check first. It maps the target to its sector and
requires a grant before Postern composes any SQL, looks up any connection, or
touches anything upstream. A denial costs no database work and leaves no partial
read.
* **It fails closed on an unknown target.** A target whose leading segment is not
one of the six raises the same access denial as an ungranted sector. A typo'd or
invented object name can never map onto a real grant.
* **Postern never compares the presented key as itself.** It stores a sha256 hash
of the key and looks the grant up by that hash. The raw key is not stored, not
logged, and not part of any lookup.
* **Every read carries the owning user as well as the sector.** Postern puts a
user clause into every SELECT it builds. A row that belongs to another user
comes back as absent rather than as a refusal.
## The two refusals
Both of these come from the REST read mirror, on the Console port. The agent port
answers its own refusals differently — see below.
| What the agent sees | What it means | Does it write a row? | What to do |
| -------------------------------------- | --------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- |
| `401` with `{"error":"unauthorized"}` | The request presented no key Postern could read. | No. A missing or malformed key writes nothing. | Check the `Authorization: Bearer` line in the agent's config. |
| `403` with `{"error":"access denied"}` | Postern read the key and said no: an unknown, revoked or expired key, or an ungranted sector. | It depends which. An **ungranted sector** writes a `deny` row. An unknown, revoked or expired **key** writes nothing here, because the mirror resolves the key before it reaches the code that records anything. | Click **Agents & keys**, click the agent, and check its status and its lit toggles. |
**The agent port is the other way round.** It answers `Unauthorized` (`401`) to a
key it refuses, and it does write a row — against the tool `initialize`, with the
reason and no agent name. So a bad key is visible in the record from one surface
and invisible from the other. [What does not get a row](/reference/audit-log#what-does-not-get-a-row)
carries the split.
Postern keeps the two kinds of "no" apart inside as well. A denial carries a
**sector** when Postern refused a real key a real sector. It carries a **reason** —
`unknown agent`, `revoked` or `expired` — when the key itself failed, and then the
row holds no sector at all. A reason never travels in the sector column, so a
refused key never appears under a sector filter.
[What one row holds](/reference/audit-log#what-one-row-holds).
### The three reasons a key itself fails
Three states refuse a key: unknown key, revoked key, expired key. Postern puts
which one it was in the record, rather than telling the caller. On the agent port
the refusal names it:
| Refusal | What it means |
| ------------------------------ | --------------------------- |
| `access denied: unknown agent` | No grant carries that hash. |
| `access denied: revoked` | The grant was revoked. |
| `access denied: expired` | The key is past its expiry. |
A key that is both revoked and lapsed reports `revoked`, because the revocation
check runs first. [Agent keys](/reference/agent-keys) carries what each verb does
to a key, and how to get a working one back.
### Refused, or quietly filtered
An ungranted sector is not always an error. Some tools refuse it and some simply
leave it out, and the difference decides whether the agent knows it is being held
back at all.
| Tool | An ungranted sector |
| ---------------------------------------------------- | ----------------------------------------------------------------------------- |
| `query`, `get_record`, `fetch_live`, `invoke_action` | Refused before any database work, naming the sector: `access denied: finance` |
| `describe_context`, `get_schema` | Filtered — you get what you are granted, nothing else |
| `list_actions` | Filtered, unless you name a sector; naming an ungranted one is a refusal |
A name whose leading segment is not one of the six is refused the same way.
[What the grant decides, tool by tool](/reference/grants-and-sectors#what-the-grant-decides-tool-by-tool)
is the same table read the other way round.
### You at the Console are not an agent
Anything that reaches Postern from the machine Postern runs on is the operator.
It resolves to the seeded user, with every sector and the agent name `operator`,
with no key and no database round-trip. Grants constrain agents, not you on your
own machine. Operator routes never read an `Authorization` header, and no agent
route is ever satisfied by where the request arrived from.
## What the record holds about a grant
A sector denial appears as an ordinary row: `decision: deny`, the sector that was
refused, and the reason `access denied: `. A refused key is the other
case, and it is above.
Postern records nothing you do to the grant itself. Create a key, rotate one, edit
its sectors or its deadline, revoke it or remove it, and Postern writes no row.
Four of those five end every live session that agent holds: a rotate, an edit to
its sectors or its deadline, a revoke and a remove. So an agent can stop mid-work
with nothing in the record to say why. A **Remove** deletes the grant but not the
trail, because the record's agent column is plain text with no foreign key to the
grant.
[What a row holds, and the honest limits of a record the database does not
enforce](/reference/audit-log).
## Confirm it works
* Ask the agent for something in a sector you did not grant. It is refused, and a
row appears under **Recent passage** with `deny` and that sector.
* Ask it for something in a sector you did grant. It answers, and the row reads
`allow`.
* Point an agent at Postern with a key you have revoked. The agent port answers
`Unauthorized` (`401`), and a row appears against `initialize` with reason
`revoked` and no agent name.
## If something went wrong
| What you see | What to do |
| ------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
| `401` and `{"error":"unauthorized"}` | Postern could not read a key at all. Check the `Authorization: Bearer` line in the agent's config, and that the word `Bearer` has a key behind it. |
| `403` and `{"error":"access denied"}`, and the agent's toggles look right | The key itself failed — unknown, revoked or expired. Click **Agents & keys** and read the agent's line. |
| `access denied: ` on one sector only | That sector is not granted. Click **Agents & keys**, click the agent, and tap it under **Grants**. The change lands at the agent's next session. |
| A refusal you cannot find in the record | Filter by agent, not by sector. A refused key writes no sector, and the REST read mirror writes nothing at all for a refused key. |
| The agent is refused and you are not | You are the operator. Anything from the machine Postern runs on holds every sector with no key. That says nothing about the agent's grant. |
## What you have now
Where the check happens, what each surface answers, and how to tell a failed key
from an ungranted sector without guessing. A reason never travels in the sector
column, so the two are always separable in the record.
## Next
what a key is, the deadline it carries, and the four verbs that change or end
one
what one row holds, what gets a row, and the honest limits of a record the
database does not enforce
# Security model
Source: https://docs.getpostern.com/reference/security-model
The premise every other rule follows from, the three properties Postern holds by design, and what nobody outside the project has reviewed.
**Before you start**
* **Your credentials are encrypted. Your data is not.** The vault holds
provider tokens and passwords. The rows Postern syncs are ordinary Postgres
columns.
* **The Console port has no password.** Which computers can reach it is the
whole of its protection.
* **Nobody outside the project has audited this code.** There has been no
external security review and no penetration test.
This page carries the premise every other rule follows from, the three properties
Postern holds by design, and the honest account of what has not been reviewed.
Each subject below has its own page.
| Page | What it answers |
| ----------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
| [Which computers can reach Postern](/reference/ports) | The two ports, the `127.0.0.1:` prefix, what protects each route group, the push-ingest route, and reaching Postern from another network. |
| [The vault and the master key](/reference/vault) | What Postern encrypts, where the master key comes from, how to rotate it, and what `docker compose down -v` destroys. |
| [Provider sign-ins](/reference/provider-sign-ins) | The pinned redirect address, what each provider needs and why, and the three credentials that behave like passwords. |
| [Agent keys](/reference/agent-keys) | What a key is, the deadline it can carry, and the four operator verbs that end one. |
| [Why an agent was refused](/reference/refusals) | Which refusal you are looking at, on which surface, and what it means. |
| [Grants and sectors](/reference/grants-and-sectors) | The permission model: the six sectors, and what one grant covers. |
| [The audit log](/reference/audit-log) | The record of agent calls: what one row holds, and what gets no row at all. |
| [MCP tools](/reference/mcp-primitives) | The tools an agent can call, and what each one returns. |
## The trust boundary
Postern serves one person on one machine. It is not a shared service, and every
rule on every page above follows from that.
| | |
| --------------- | -------------------------------------------------------------------------------------------------------------------------------- |
| **Trusted** | You, and the machine Postern runs on. |
| **Not trusted** | The network that machine sits on. The other devices in the house. The pages your browser has open. Every agent that holds a key. |
Anyone with a login on that machine already holds the database, the vault key
file and your browser. Postern defends nothing against them.
Postern opens two ports, and it opens both to this computer only. Only this
computer can reach these addresses. Nothing on your Wi-Fi, and nothing on the
internet, can. The database gets no port at all.
[Which computers can reach Postern](/reference/ports) carries both ports, what
protects each route group, and the one line in `docker-compose.yml` the whole
claim rests on.
Postern is open source, so you do not have to take any of this on trust.
## What Postern enforces by shape
Three properties hold by design:
* **The resolved identity is the first argument** of every function that returns
data, and the sector check runs before any SQL. Postern scopes every read to the
user on that identity. No path reads without one.
* **A secret never lives in a row.** A credential row carries a pointer into the
vault and nothing more. A domain row carries no pointer at all.
* **An unknown sector fails closed.** Postern refuses a target whose first word is
not one of the six sectors. A typo therefore never maps onto a grant you did
give.
[SECURITY.md](https://github.com/getpostern/postern/blob/main/SECURITY.md) in the
repository carries the project's full list. It covers properties this page has not
verified line by line.
## The record
Postern writes every agent read and every action to the record. It records what
happened; it never stops anything, and no call waits for a line to land. That
makes the record the compensating control for everything a grant cannot express,
and it is the reason nothing on this page claims to prevent an agent from
misbehaving.
**The record covers what your agents did, not what you did to your agents.** Six
acts leave no row at all. They are: create a key, rotate one, edit its sectors or
its deadline, revoke it, delete it, and set a connection's sync window. Keep your
own note of those. [What does not get a row](/reference/audit-log#what-does-not-get-a-row)
lists them.
Postern redacts credential-shaped arguments before it stores them.
[What the arguments hold](/reference/audit-log#what-the-arguments-hold) names the
fields and the cap. [The audit log](/reference/audit-log) carries what a row
holds and what gets one. Nothing in the database stops a row being changed or
deleted, so the record's integrity rests on the application and on your own
Postgres roles —
[the honest limits](/reference/record-limits#nothing-enforces-immutability).
## What has not been reviewed
Nobody outside the project has audited this code. There has been no external
security review and no penetration test. The review in the repository's own
history is internal — the same people who wrote the code, who then read it again.
One known question sits inside that gap. The push-ingest secret is the only
comparison in Postern that takes the same time whether the value is right or
wrong. Postern hashes agent keys and OAuth-bridge tokens with SHA-256 and looks
the digest up in Postgres by equality, which does not have that property. The
database compares a digest of the presented value rather than the value itself.
**We do not know whether that difference is reachable across a network**, and the
project has published no analysis of it.
Postern is pre-1.0. The supported version is the latest release. Fixes go into the
next release, and older releases do not get them, so update to stay fixed.
To report something, use GitHub's private vulnerability reporting on
[the postern repository](https://github.com/getpostern/postern). It opens an
advisory only the maintainers can see. There is no security mailbox, and an
exploitable finding should not go in a public issue. Read the scope section of
[SECURITY.md](https://github.com/getpostern/postern/blob/main/SECURITY.md) first.
Two properties sit on its out-of-scope list on purpose. The admin routes carry no
per-request authentication when a caller reaches them from this computer, and
Postern does not encrypt the cached data at rest.
## What you have now
One line you can state flatly. Your credentials are encrypted and your data is
not, and both ports stay opened to this computer only until you decide otherwise.
Three standing costs come with that. The Console port's protection is its address,
so anything that widens which computers can reach it removes the protection
entirely. The vault key file is the whole secret, so your copy of it is the only
recovery path there will ever be. And nobody outside the project has reviewed any
of this.
## Next
the two ports, the `127.0.0.1:` prefix, and what protects each route group
what is encrypted, where the master key lives, and what destroys it
# The vault and the master key
Source: https://docs.getpostern.com/reference/vault
What Postern encrypts and what it does not, where the master key comes from, how to rotate it, and the one command that destroys it for good.
**Before you start**
* **Your credentials are encrypted. Your data is not.** The vault holds
provider tokens and passwords. The rows Postern syncs are ordinary Postgres
columns.
* **Either you hold the master key or Postern does.** Which one it is decides
half of this page.
* **The key file is the whole secret.** There is no passphrase and no escrow.
Anything that can read that file can open the vault.
* **`docker compose down -v` destroys it.** Every credential encrypted under
that key becomes permanently unopenable, and no recovery path exists.
## The credential vault
Postern encrypts every password a source gave you before it reaches the database.
It never hands a source password to an agent, on any path.
**In the vault:** OAuth access and refresh tokens, app-specific passwords,
SimpleFIN access URLs, Home Assistant tokens and Plaid item tokens. Postern also
encrypts the client secrets of the provider apps you register yourself.
They live in one `secrets` table. A credential row holds only a pointer of the
form `sec_`, never the secret. Postern never writes a secret into a data
row, and no route ever returns one.
| | |
| --------------------------- | -------------------------------------------------------------------------------------------------------------- |
| Cipher | AES-256-GCM |
| Per record | a fresh one-time value, never reused, and a check value stored with the encrypted text |
| Bound into that check value | the owning context — user, provider, purpose |
| Checked on the way out | the stored context must equal the one the caller re-derives, and then Postern verifies the check value over it |
A record encrypted for one purpose does not open as another, and a swapped
pointer fails rather than decrypts. `SECURITY.md` carries the exact algorithm
parameters and the rest of the cryptographic detail.
**There is no password on the vault.** The master key is 32 raw bytes. Either
Postern generates them on first use, or you supply them in `PCI_MASTER_KEY` as
base64 of exactly 32 bytes. Postern refuses a value that decodes to any other
length outright, and never pads or truncates one. There is no passphrase, no key
derivation and no escrow. The key file is the secret, and anything that can read
it can open the vault.
| Order | Where the key comes from | Label |
| ----- | ---------------------------------------------------------------------------------------------- | ------------------------------------------------- |
| 1 | `PCI_MASTER_KEY` in `.env` — a key you manage yourself | `env`, or whatever you set in `PCI_MASTER_KEY_ID` |
| 2 | the key file at `PCI_MASTER_KEY_PATH`, default `.pci/master.key` | `file` |
| 3 | first use — Postern generates one and writes it to that path, mode 0600 under a 0700 directory | `auto` |
Postern generates the key the first time it encrypts a credential, not at first
boot. A Postern that has connected nothing has no key yet. Under Docker the
`pci_master_key` volume mounts at `/app/.pci`, so a generated key file is
`/app/.pci/master.key` — inside that volume, never in your checkout.
Postern looks an encrypted record up by the **label** of the key that encrypted
it, not by the key. So when Postern refuses to start over the vault, read
`PCI_MASTER_KEY_ID` in `.env` before you reach for a backup. The key can be
perfectly intact with only its label changed: set, unset, or edited. The refusal
message names the label it wanted. Set `PCI_MASTER_KEY_ID` back to that label,
then run `docker compose up -d app`. Nothing needs to be restored.
### A disconnect removes the credential, not the data
Postern sets the connection and its credential to revoked, so nothing schedules
another sync. Then it deletes the encrypted access token, the refresh token and
the stored client secret from the vault. The cached rows are a third thing, and
Postern leaves them alone.
### Rotating the master key
Rotation is offline. Postern re-encrypts every record under the new key, in place
under the same pointers, so nothing that points at a secret has to change. An
interrupted run resumes, because Postern derives the new key's label from the key
bytes and the same command skips the records it already re-encrypted.
Never rotate between the moment you copy the key and the moment you copy the
database. After a rotation an older database copy needs the older key. Keep the
pre-rotation backup until every connection reads `ok` again.
```bash theme={"system"}
# 1. Take a full backup first — see /operate/backup-and-export.
# 2. Stop Postern. Leave Postgres up; the tool needs it.
docker compose stop app && docker compose up -d db
# 3. Re-encrypt. --new must be inside /app/.pci. Write down the label it prints.
docker compose run --rm --entrypoint node app \
dist/secrets/rotate.js --new /app/.pci/master.key.new
# 4. Read the new key out and base64 it.
KEYVOL=$(docker inspect -f '{{range .Mounts}}{{if eq .Destination "/app/.pci"}}{{.Name}}{{end}}{{end}}' "$(docker compose ps -aq app)")
docker run --rm -v "$KEYVOL":/k alpine cat /k/master.key.new | base64 | tr -d '\n'
# 5. Put PCI_MASTER_KEY and PCI_MASTER_KEY_ID in .env — both, together — then:
docker compose up -d app
curl -fsS http://localhost:8787/healthz # {"status":"ok"}
```
`PCI_MASTER_KEY_ID` defaults to the literal `env`, so a key supplied without its
label matches none of the re-encrypted records and Postern refuses to boot.
[docs/runbooks/key-rotation.md](https://github.com/getpostern/postern/blob/main/docs/runbooks/key-rotation.md)
in the repository is the full procedure. It covers the source-checkout form too.
## What the vault does not cover
**Encrypted by Postern:** the credentials above, and nothing else.
**Not encrypted by Postern:** everything it syncs. Your transactions, mail
envelopes, calendar events, contacts and health samples are ordinary columns in
your Postgres, readable by anything that can read the database. What protects
them is database access control and whatever disk encryption the machine
provides.
Postern ships nothing that encrypts your data at rest, and this page carries no
procedure for it. Full-disk encryption on the machine Postern runs on is the
usual answer: FileVault on macOS, LUKS on Linux, BitLocker on Windows. Each
vendor documents its own.
One narrower fact cuts the other way. The mail table has no column for a message
body or an attachment. Postern stores who sent it, the subject, the dates and the
preview line. It never stores the message text. Postern fetches a body from the
provider when an agent asks for that one message.
## Losing the vault key
`docker compose down -v` deletes the named volumes, and `pci_master_key` is one
of them. Every credential encrypted under that key becomes permanently
unopenable. The ciphertext is all that survives, and no recovery path exists —
not in this project, not anywhere. `docker compose down` without the `-v`
removes the containers and leaves the volumes alone.
If Postern cannot open the vault at start-up, it refuses to start rather than
start broken. The migrations run first. Then, before Postern serves any port, it
opens one encrypted record per distinct key label among the credentials its live
connectors need. If any of those fails, Postern refuses to start. It names the
label, the count and the first pointer that failed, and it reports that it changed
nothing. No environment variable, flag or setting skips that check.
The check is deliberately narrow, so a real read is still the verification that
counts. A wrong key restores cleanly and then decrypts nothing.
### The backup banner, and how to stop it
Postern prints a banner headed `VAULT KEY IS NOT BACKED UP` on its own log at
every start. Three things have to be true for it: Postern generated the key
itself, the key file is there, and no marker file sits beside it. That is the
whole check. Postern never looks at your backup. It never reads the marker's
contents, and it never hashes or fingerprints the key.
The banner's last line tells you to acknowledge in the Console. **No such control
ships today** — no button, no page, no route. The function that would write the
marker exists in Postern's code, and nothing calls it. The banner is a reminder,
not an error, and Postern starts anyway.
Take your copy of the key first.
[Back up, export and erase](/operate/backup-and-export) is the procedure. Then
stop the banner one of these two ways.
**Write the marker yourself.** The marker is a file beside the key. Its name is
the key's own filename plus `.backed-up`, so on a stock Docker install it is
`/app/.pci/master.key.backed-up`. In the folder that holds `docker-compose.yml`,
run:
```bash theme={"system"}
docker compose exec app sh -c \
'date -u +%Y-%m-%dT%H:%M:%SZ > /app/.pci/master.key.backed-up && chmod 600 /app/.pci/master.key.backed-up'
```
Postern only checks that the file is there. Write the date into it anyway, so a
later you knows when you took the copy. If you set `PCI_MASTER_KEY_PATH`, use
that path plus `.backed-up` instead. The marker sits in the same volume as the
key on purpose. `docker compose down -v` takes both, and a marker that outlived
its key would be a lie.
**Hold the key yourself** — but only on a Postern that has connected nothing
yet, or through [the rotation above](#rotating-the-master-key). Set
`PCI_MASTER_KEY` in `.env` to a base64 32-byte value you keep, then restart.
Postern then treats the key as yours: no marker, and the banner never prints
again. Point a new key at a vault an old key filled, and Postern refuses to
start.
The banner comes back after every restore. A restore seeds the key into a new,
empty volume, and the marker was in the old one. Write it again.
### Behaviours you will meet
| Behaviour you will meet | Why |
| ----------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `scripts/backup.sh` exits with `refusing a keyless backup` and writes nothing | It reads the key from a host path, `.pci/master.key`. Under Docker the key is inside the `pci_master_key` volume, so no such file exists. When you manage the key yourself it writes a note that records that, and you still archive the value yourself. |
| The database copy needs no password | The command runs inside the database container and connects over that container's own socket. The database service opens no port to the machine at all. |
| Migrations are harmless on a restored database | They see an already-current schema and change nothing. The vault check runs before Postern serves any port, which is why `/healthz` answers nothing for the first few seconds after `docker compose up -d app`. |
| You can run the same erase twice | The deletes run as independent statements, not one transaction, and a repeated delete does nothing. An erase that stops partway is fully recovered by the same command again. |
| A restore pipes the key through standard input | That keeps the key off any folder shared between your machine and the container. |
`/api/export` answers on this computer only, like every other admin route —
[what protects each route group](/reference/ports#the-console-has-no-authentication).
## Confirm it works
* `docker compose ps` shows `app` as `healthy`, so the vault check passed at
start-up.
* A source you connected reads `ok` in the Console, which is a real decryption
rather than the narrow start-up check.
* If you took your own copy of the key, the marker file sits beside it and the
`VAULT KEY IS NOT BACKED UP` banner no longer prints at start.
## If something went wrong
| What you see | What to do |
| -------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Postern refuses to start and names a key label | Read `PCI_MASTER_KEY_ID` in `.env`. Set it back to the label the message names — `env`, `file` or `auto` — then run `docker compose up -d app`. The key is usually intact and only its label changed. |
| `VAULT KEY IS NOT BACKED UP` on every start, after you took a backup | Expected. No Console control writes the acknowledgement marker today. Write the marker yourself, or hold the key yourself: [the backup banner](#the-backup-banner-and-how-to-stop-it). |
| Postern restored cleanly and then every source fails | The key does not match the database copy. A wrong key restores cleanly and then decrypts nothing. Restore the key that belongs to that copy, or the pre-rotation key if you rotated after taking it. |
## What you have now
Your credentials are encrypted and your data is not. The master key is 32 raw
bytes with no passphrase behind it, so your own copy of that file is the only
recovery path there will ever be — and `docker compose down -v` ends it for good.
## Next
the copy to take, the order to take it in, and what erase leaves behind
what each provider needs, and the three credentials that behave like
passwords
# Connect an agent
Source: https://docs.getpostern.com/start/connect-an-agent
Paste one config block into Claude Code or Cursor. Claude Desktop needs a bridge. claude.ai and ChatGPT need a public address first.
**Before you start**
* **Postern, installed and started.** Open the Console at `http://localhost:8787`.
If Postern runs on another computer, [open the Console over
SSH](/start/install#open-console) first.
* **An agent key, in front of you.** Postern shows a key once, then keeps only a
scrambled copy. If you have none, [create one](/start/first-key).
* **The agent you want to connect.** You restart it at the end of this page.
* **claude.ai or ChatGPT only: a public https address on port 443, and a key with
an expiry.** [Set up remote access](/start/remote-access#publish) builds the
address.
## Choose your path
MCP is the standard way AI assistants connect to outside tools. Postern speaks it,
so Claude, ChatGPT and Cursor connect the same way.
| Your agent | Then |
| ------------------------------------------------------------------------------------- | ---------------------------------------- |
| Claude Code or Cursor — on the same computer as Postern, or on your Tailscale network | [copy the config block](#connect-config) |
| Claude Desktop — it can only start a program on your computer | [add the bridge](#stdio-bridge) |
| claude.ai or ChatGPT — they run on the vendor's servers | [publish an address first](#hosted) |
Open Console → **Agents & keys**. Your keys sit under **The register**. Read the
**Granted sectors** column for the key you are about to use.
A sector is one area of your life: finance, mail, calendar, contacts, health, home.
It is the smallest thing you can grant.
A new key can reach nothing until you tick a sector. A key with no sectors connects
successfully, and Postern then denies every read. The form warns you under the button: `No
sectors granted yet — this key would be denied everything until you edit its
grants.` A connection that succeeds can still answer nothing.
[Default-deny](/reference/grants-and-sectors#default-deny).
A grant covers read and act across every provider in that sector, and there is
nothing narrower. Only Home Assistant has anything to act on today.
[What a grant covers](/reference/grants-and-sectors#what-a-grant-covers).
To widen a key, click the agent's name and tap the sector you want under
**Grants**. Postern saves at once and prints `Tap to toggle; the change applies at
the agent's next session.` Postern ends that agent's live sessions when you change
a grant, so the new sectors apply the next time it connects. The key itself does
not change, so you paste nothing a second time. [Read a grant, and change
it](/reference/grants-and-sectors#read-a-grant-and-change-it).
To replace a key you have lost, rotate it:
1. Press **Rotate** on that key's row.
2. Tick sectors under **Grant which sectors**.
3. Press **Rotate the key**. Postern shows you the new key once.
The old key dies at that moment, along with every token made from it. Postern
disconnects any agent that holds it. [What revoke and rotate
destroy](/reference/agent-keys#revoking-rotating-and-removing).
If this key will go into claude.ai or ChatGPT, set an expiry before you create it.
The sign-in refuses a key that never expires: `This agent key never expires. Keys
used with a cloud client must have an expiry — mint or rotate a key with a
30/90/365-day expiry in the Console, then try again.` The chips under **Expires**
read **Never**, **30 days**, **60 days** and **90 days**. There is no 365-day
chip. [Set one when you create the key](/start/first-key#expiry).
Open Console → **Agents & keys** and scroll to the bottom of the page. The last
section reads **Connect an agent**. It shows **MCP endpoint** with its own **Copy**
button, then three columns: **Local · stdio**, **Remote · bearer** and
**Hosted · claude.ai, ChatGPT**.
1. Under **Remote · bearer**, press **Copy recipe · keyless**. The Console answers
`Recipe copied — paste your key where marked`.
2. Paste it into a text editor. It looks like this:
```json theme={"system"}
{
"mcpServers": {
"postern": {
"type": "http",
"url": "http://localhost:8788/mcp",
"headers": {
"Authorization": "Bearer "
}
}
}
}
```
3. Replace `` with your key. **Delete the angle brackets too.**
Postern refuses `Bearer `. It accepts `Bearer abc123`.
Use the address the Console prints, not the one above. Your port may differ.
[The endpoint](/reference/mcp-primitives#the-endpoint).
**If you created the key a moment ago**, use the block on that screen instead. Press
**Copy config · key included**. It already holds your key.
Where the address should be, the Console prints a sentence instead. Which sentence
tells you what to do.
`This gateway isn’t serving MCP, so it has no address to point an agent at. Set
MCP_HTTP_PORT on the box and restart it.` — or, on the screen after you create a key, `This
gateway isn’t serving MCP yet, so it has no address to pair with this key.` Both
mean the same thing. Open `.env` beside `docker-compose.yml`. Add the line
`MCP_HTTP_PORT=8788`. Save it. In that same folder, run `docker compose up -d`.
`This gateway didn’t answer with its exposure state — the request failed, which
says nothing about how the gate is configured. Reload to try again.` — the
Console's own request failed. Reload the page.
Open your agent's MCP config file — Claude Code's `.mcp.json`, Cursor's `mcp.json`.
Create the file if it is not there.
Paste the **whole block**, from the first `{` to the last `}`. Save it. Then quit the
agent and start it again.
Your agent now lists seven Postern tools: `describe_context`, `get_schema`, `query`,
`get_record`, `fetch_live`, `list_actions` and `invoke_action`.
**Claude Code takes the same thing as one command.** It writes your key into your
shell history, which the pasted block avoids:
```bash theme={"system"}
claude mcp add --transport http postern http://localhost:8788/mcp --header "Authorization: Bearer "
```
That command does not touch `.mcp.json`. Where it writes is `--scope`, and the
default is `local` — the folder you run it in, and no other. Run it in the folder you
work in, or pass `--scope user` or `--scope project`.
Your agent runs on a different computer from Postern, and the connection fails or
times out. `http://localhost:8788/mcp` answers only on the machine Postern runs on.
Put Postern on your Tailscale network first: [open two ports to your own
devices](/start/remote-access#your-devices). Then use the tailnet address that step
hands you. An SSH tunnel to the Console does not reach the agent port.
Claude Desktop cannot open a connection to an address. It can only start a program on
your computer and talk to it. Postern is not that program. It already runs, and it
already holds its own input.
[Postern offers no stdio](/reference/mcp-primitives#postern-offers-no-stdio).
Postern supports Claude Desktop through a bridge that Claude Desktop starts for
itself: `mcp-remote`. To Claude Desktop the bridge is a program; to Postern it is an
ordinary agent. It needs the same two values as every block on this page — the `/mcp`
address, and the header `Authorization: Bearer `. Take both from
**Remote · bearer** in Console → **Agents & keys**, which is where the Console sends
you too.
Claude Desktop reads a file called `claude_desktop_config.json`. On macOS it sits at
`~/Library/Application Support/Claude/claude_desktop_config.json`.
**No block to paste yet.** Nobody has run `mcp-remote` against Postern and recorded
what worked, so this page prints no `command` and no `args` rather than a guess.
The tool's own documentation carries them:
[mcp-remote](https://github.com/geelen/mcp-remote). Claude Code and Cursor are the
checked paths today.
claude.ai and ChatGPT connect from the vendor's own servers. They can never reach
your own computer or your Tailscale network, and they connect on port 443 only — the
standard port for secure websites. Postern publishes nothing until you ask.
**Publish first.** Open Console → **Settings** → **Remote access** → the row
**Public · the address this gate answers on**. [Set up remote
access](/start/remote-access#publish) walks the whole of it. Use port 443. On any
other port a hosted agent's request never reaches you at all, and no log at either
end shows it.
Save your agent key somewhere safe before you copy anything else. The sign-in asks
for the key at the **end**, in another app, after the Copy button below has
replaced it on your clipboard. Witnessed 2026-08-01: the address went into the key
field, and the sign-in answered `That agent key was not accepted. Check the key in
the Console and try again.`
**Copy the address.** Open Console → **Agents & keys** → **Set up the bridge →**. The
reveal screen's **Connect a hosted client (claude.ai, ChatGPT) →** opens the same
page. Under **Paste this into claude.ai or ChatGPT**, press **Copy**. The value is
your published address plus `/mcp` — if Settings saved
`https://your-mac.tailnet.ts.net`, this reads `https://your-mac.tailnet.ts.net/mcp`.
The Console shows that **Copy** button only for an address a hosted agent can use:
`https`, on port 443.
**Connect claude.ai.** In claude.ai, open its settings and find its connectors. Add
a connector of your own. Paste in the address you copied. If it asks for a client id
or a client secret, leave both empty. Postern issues no client secret, and it
registers the agent itself.
**Nobody has captured claude.ai's dialog, so this page names nothing on it.** One run,
on 2026-07-21, is the whole record. It offered a client id and a client secret, the
founder left both empty, and the connection worked. What claude.ai calls the address
field is unknown. Whether it ever asks how you want to sign in is unknown too. If
yours asks, the Console's own advice is to choose OAuth. One screenshot of that dialog
settles both.
claude.ai then opens a page your own Postern serves, headed **Authorize agent
access**. It names the app — `Claude`, for claude.ai — and the address your sign-in
code goes to. Under **Paste an agent key from the Console**, paste your agent key.
Press **Approve**. claude.ai holds a token that rotates from then on. That sign-in
page turns on with the address; there is no separate switch. [The OAuth bridge, for
hosted agents](/reference/oauth-bridge).
**Connect ChatGPT.** ChatGPT's path is longer. It adds a developer-mode switch, a
page that carries three different names, and an approval popup served by your own
machine. [Connect ChatGPT](/connect/chatgpt) walks it end to end.
## Confirm it works
* Your agent lists seven Postern tools after the restart.
* You type `What context can you reach?` into the agent. It answers with the sectors
you ticked for that key, and how fresh each connection is — and nothing outside them.
* Console → **The ledger** shows a new row: your agent's name under **Who**,
`describe_context` under **Tool**. Leave the **Sector** filter off —
`describe_context` belongs to no sector, and that filter drops exactly those rows.
* That row's **Decision** column is empty, not `deny`.
## If something went wrong
| What you see | What to do |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Your agent lists no Postern tools after the restart | Check three things. You pasted the whole block, from the first `{` to the last `}`. You deleted the angle brackets around ``. You quit the agent and started it again, rather than reload a window. [Paste the block and restart it](#paste-and-restart). |
| `This gateway isn’t serving MCP, so it has no address to point an agent at. Set MCP_HTTP_PORT on the box and restart it.` | Open `.env` beside `docker-compose.yml`. Add the line `MCP_HTTP_PORT=8788`. Save it. In that same folder, run `docker compose up -d`. [Copy the config block](#connect-config). |
| The agent connects, and every read comes back denied | That key opens no sectors. Console → **Agents & keys** → the agent's name → tap a sector under **Grants**. The key does not change; the agent's session ends there, so connect it again. [Check what your key opens](#agent-key). |
| The agent answers empty, and Console → **The ledger** shows no new row | Nothing reached Postern. An agent can describe a call it never made, so trust the record over the answer. A key that arrived and that Postern refused writes a row of its own: no name under **Who**, `initialize` under **Tool**, and nothing under **Sector** — so leave the **Sector** filter off to see it. Check the address and the key, then try once more. |
| claude.ai says `Couldn't connect to the server. Check that the URL points to a valid MCP server.`, or `Couldn't reach Postern. You can check the server URL and verify the server is running.` | claude.ai could not reach you. Both are about the address, and the usual cause is a port other than 443. Fix the address, wait five minutes, then try once. [Publish an address](#hosted). |
## What you have now
An agent that holds a key, and that key opens exactly the sectors you ticked. It
reads from Postern's local cache. It can act only where the source allows, which
today means Home Assistant alone.
Every tool call that agent makes — served, refused or failed — lands in the record
under its name. Postern only ever adds to the record. [What gets a
row](/reference/audit-log#what-gets-a-row). What you do to the key is not there.
Postern writes no row when you create a key, rotate one, edit its sectors or its
deadline, revoke it or remove it. [What does not get a
row](/reference/audit-log#what-does-not-get-a-row).
Your config file now holds your agent key. Store it where your other passwords live.
[Agent keys](/reference/agent-keys#what-an-agent-key-is).
With no sources connected, your agent connects fine and answers empty. The Console
reads **Add your first source**. That is the next thing to do, not a repair.
## Next
Pick the source you can finish now.
your own Google Cloud app + one app password · about 20 minutes · weekly
re-consent until you publish to production
Health Auto Export on your iPhone · about 10 minutes · push, not pull
The rest, by sector:
* **Finance** — [SimpleFIN](/connect/simplefin), [Plaid](/connect/plaid)
* **Health** — [WHOOP](/connect/whoop)
* **Mail, calendar and contacts** — [Microsoft](/connect/microsoft), [iCloud](/connect/icloud)
* **Home** — [Home Assistant](/connect/home-assistant)
You need not change any agent when you connect a source. A granted sector covers
every provider in it, now or later.
# Mint your first key
Source: https://docs.getpostern.com/start/first-key
Create one agent key in the Console: name it, tick the sectors it may reach, set when it expires, and store it before you leave the screen.
**Before you start**
* **Postern started, and the Console at [http://localhost:8787](http://localhost:8787).** You need
no source yet. If Postern runs on a computer with no screen,
[open the Console over SSH first](/start/install#open-console).
* **A few minutes.** Nothing on this page reaches an outside service.
* **A name.** Name the key after the agent, machine or person that will hold it. Do not name it
after the job you want done.
* **Your password manager, open.** Postern shows this key once, and never again.
In the Console, click **Agents & keys** in the left sidebar. Click **Mint a key**. On a first install
the list is empty, and that button sits inside the **No keys issued yet** card. The form opens.
Give this agent a name no other agent has. One name holds one key. Type a name that already exists
and Postern replaces that agent's key. Its sectors and its deadline become whatever this form now
says, and Postern clears a revoke you had made. Every agent still on the old key stops at once.
[Postern deletes every token derived from the old key too](/reference/agent-keys#revoking-rotating-and-removing).
In **Name**, type the name. The field shows `my-agent` in grey — that is an example, not a value.
**Mint the key** stays greyed out until you type something.
Console → **The ledger** prints this name under **Who** for every call the key makes. It records what
the key does, never what you do to the key.
[What does not get a row](/reference/audit-log#what-does-not-get-a-row).
Under **Grant which sectors**, tick each sector this agent may reach. The six toggles read
**Finance**, **Mail**, **Calendar**, **Contacts**, **Health** and **Home**, in that order. No sector
starts ticked, and the form says so:
`Nothing is granted until you pick it. Tap a sector to toggle it.`
A sector is the smallest thing you can grant. Tick **Mail** and you grant every mail source you have
connected, and every one you connect later. There is no read-only setting:
[a grant covers read and act across every provider in the sector](/reference/grants-and-sectors#what-a-grant-covers).
Only **Home** has anything to act on today.
The screen after the button lists the same sectors under **Opens**, in lower case — `finance`,
`mail`. Postern prints them that way everywhere it recaps a grant, including the **Granted sectors**
column of the register. The toggle you tick and the word you read back are the same sector.
You can press **Mint the key** with nothing ticked, and the form says what that costs you:
`No sectors granted yet — this key would be denied everything until you edit its grants.` Such a key
connects, and Postern then denies every read.
Under **Expires**, click one of four chips: **Never**, **30 days**, **60 days** or **90 days**.
claude.ai and ChatGPT refuse an agent key that never expires. If this key will go to either, click
**30 days**, **60 days** or **90 days**. Choose **Never** and their sign-in stops with
`This agent key never expires. Keys used with a cloud client must have an expiry…` — and only a
rotate gets you back in.
Which chip the form starts on follows your remote access. If you have not published a public address,
it starts on **Never**. If you have, it starts on **90 days** and adds the line
`This gate is published. A key you paste into a hosted client should expire.`
Choose by where the key will live. A key that never leaves this computer may sit at **Never**.
[Postern refuses a key at the instant it expires, and refuses to move a lapsed key's deadline](/reference/agent-keys#expiry).
Postern shows this key once, on the screen after the button. It keeps a scrambled copy it can check
against, never the key itself — no reveal button, nothing to recover. Leave without the key and your
only way back is a rotate, which replaces it. Open your password manager first.
Press **Mint the key**. The reveal screen opens. Do four things on it, in this order.
On the rotate path the same form reads differently, so look for different words. Its heading is
`Rotate ` with your agent's name in it, the button reads **Rotate the key**, and **Name** is
locked with the hint `The name carries over on rotate — one key per agent.` The sectors and the
deadline arrive already set to what that key held. Everything after the button is identical.
1. Under **Agent key — shown once**, press **Copy**. The Console answers
`Key copied — store it now; it isn't shown again`. Paste the key into your password manager now.
Every other **Copy** button on this screen overwrites your clipboard.
2. Read **Opens**. It lists the sectors you granted, followed by
`read and act, across every provider in each`. With none it reads
`no sectors — this key is denied everything`.
3. Read **MCP endpoint**. That is the address on this computer, and it is the only address this
screen ever shows. It still reads that way after you publish a public address. claude.ai and
ChatGPT cannot reach it.
4. Under **Connect config**, press **Copy config · key included**. Paste the whole object into your
agent's MCP config file — Claude Code's `.mcp.json`, Cursor's `mcp.json`. Then restart that agent.
The key is already in it, and there is nothing to fill in.
Where the address should be, the card can print
`This gateway isn’t serving MCP yet, so it has no address to pair with this key.` There is then no
**Connect config** block either. Your key is good. Postern serves no agent port.
[Set `MCP_HTTP_PORT` and restart it](/start/connect-an-agent#connect-config).
Press **Done** to return to Agents & keys. The link **Connect a hosted client (claude.ai, ChatGPT) →**
opens the hosted sign-in instead. That path needs a public address first:
[set up remote access](/start/remote-access#publish), then
[connect the agent](/start/connect-an-agent#hosted).
## Confirm it works
* Console → **Agents & keys** → **The register** lists your agent by name.
* Its sub-line counts the days down — `expires in 90d` for a 90-day key — or reads `never expires`.
* Its **Granted sectors** are the ones you ticked, and nothing else.
* The key is in your password manager, not only on your clipboard.
## If something went wrong
| What you see | What to do |
| ----------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Postern denies every read the agent makes | The key holds no sector, or not the sector the agent asked for. In Console → **Agents & keys**, click the agent and tick the sectors it needs under **Grants**. [Tick the sectors it may reach](#grant-sectors). |
| A sign-in answers `That agent key was not accepted. Check the key in the Console and try again.`, or you left the reveal screen without the key | Nothing can show that key again. In Console → **Agents & keys**, click the agent, press **Rotate**, then copy the new key from the reveal screen. [Store it before you leave the screen](#mint). |
| A sign-in says the key never expires, or an agent that worked yesterday fails today with nothing changed | Both are the deadline, and Postern will not move a lapsed key's. In Console → **Agents & keys**, click the agent, press **Rotate**, click **30 days**, **60 days** or **90 days**, then press **Rotate the key**. Hand the new key to the agent. [Set when it expires](#expiry). |
## What you have now
Your key opens the sectors you ticked, until the deadline you set, and nothing else. You have
connected no source to it yet.
Treat the key as a password: every config file you paste it into now holds a secret. If it gets loose,
revoke or rotate the agent.
[That ends the key and every token derived from it at once, and cuts its live sessions](/reference/agent-keys#revoking-rotating-and-removing).
Postern touches no source password, and nothing upstream changes.
## Next
a key you created · a few minutes, plus a restart of the agent ·
claude.ai and ChatGPT need a public address first
# Install Postern
Source: https://docs.getpostern.com/start/install
Run Postern under Docker on a machine you own, then open its Console.
**Before you start**
* **Docker.** [Install Docker](https://docs.docker.com/get-docker/) first. It is the only thing
you install by hand.
* **A machine that stays on.** While it is off, your agents reach nothing. Keep it updated, the
same as anything else you run.
* **About 10 minutes,** plus the time the image takes to download.
* **Somewhere to keep one password.** You create it in [step 2](#password). Postern's database
never accepts a different one afterwards, so open your password manager now.
* **Windows: not tested.** Postern runs under Docker, so Windows should work. Nobody has run it
there. Treat every Windows line on this page as untested.
## Choose your path
| Postern will run on… | Then |
| -------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- |
| the computer in front of you | Follow all four steps as written. |
| another computer — a NAS, a spare machine, a computer with no screen | Sign in to that computer over SSH. Run steps 1 to 3 there, then [forward the Console port](#open-console) in step 4. |
Postern runs either way. A NAS or a spare machine works the same as the computer in front of you.
The second path needs SSH on that computer, and nothing else changes.
Open a terminal on the machine that will run Postern. On macOS, press **Command-Space**, type
`Terminal`, press **Return**. On Windows, press the **Windows** key, type `PowerShell`, press
**Return**.
Make a folder and download the one file Postern needs:
```bash theme={"system"}
mkdir postern && cd postern
curl -O https://raw.githubusercontent.com/getpostern/postern/main/docker-compose.yml
```
On Windows, type `curl.exe` — in PowerShell, `curl` means something else. Nobody has tested these
lines:
```powershell theme={"system"}
mkdir postern; cd postern
curl.exe -O https://raw.githubusercontent.com/getpostern/postern/main/docker-compose.yml
```
The folder now holds one file, `docker-compose.yml`. Every command below runs from this folder.
You can clone the whole repository instead, if you have Git:
`git clone https://github.com/getpostern/postern.git && cd postern`. Postern needs nothing else
from it.
Postern's database needs one password. It lives in a file named `.env`, beside
`docker-compose.yml`.
Postgres records this password the first time it starts. It never accepts a different one against
the same data, and there is no way to change it afterwards. Keep `.env`. Do not type the password
in front of `docker compose up`. That creates a new one on every run, and every other
`docker compose` command then fails.
In that folder, run the line for your system. It makes a password of letters and digits only. A
`/`, `:`, `@`, `?`, `#`, `&` or `+` breaks the address Postern uses to reach its database. Postern
then exits at once. `openssl rand -base64 32` is not a substitute: its output holds those characters
often.
```bash theme={"system"}
printf 'POSTGRES_PASSWORD=%s\n' "$(openssl rand -hex 24)" > .env
```
On Windows, run these four lines in PowerShell. Nobody has tested them:
```powershell theme={"system"}
$b = New-Object byte[] 24
[Security.Cryptography.RandomNumberGenerator]::Create().GetBytes($b)
$hex = [BitConverter]::ToString($b).Replace('-','').ToLower()
Set-Content -Path .env -Value "POSTGRES_PASSWORD=$hex" -Encoding ascii
```
`.env` now holds one line: `POSTGRES_PASSWORD=` and 48 letters and digits. That is the whole of
Postern's required configuration. Every other setting has a working default.
Copy that line into your password manager now. The leading dot makes `.env` invisible in Finder and
File Explorer. Do not make `.env` in Notepad — Notepad adds `.txt` to the name.
Docker must be open first. On macOS and Windows, open the **Docker Desktop** application and wait
for it to finish its own start-up. On Linux, Docker runs as a service and needs nothing opened.
From the folder that holds `docker-compose.yml`, start Postern:
```bash theme={"system"}
docker compose up -d
```
The first run downloads the image `ghcr.io/getpostern/postern`, so it takes minutes. Later runs take
seconds. The image runs on Intel and AMD machines, and on ARM machines such as Apple Silicon.
Postern sets up its database tables before it answers anything, so port 8787 stays quiet for a few
seconds after the command returns.
Postern opens two ports to this computer only: **8787**, the Console port, and **8788**, the agent
port. Only this computer can reach these addresses. Nothing on your Wi-Fi, and nothing on the
internet, can. The database gets no port at all. Only Postern reaches it, over the private network
Docker Compose creates.
If another program already holds 8787 or 8788, the `app` container does not start. Add a line to
`.env`, below the password line:
```
REST_PORT=8790
```
Then run `docker compose up -d` again. The Console now answers at `http://localhost:8790`, and
every `8787` below becomes `8790`. `MCP_HTTP_PORT` moves the agent port the same way. If you
already connected [Google](/connect/google), [Microsoft](/connect/microsoft) or
[WHOOP](/connect/whoop), change the address you registered there to the new port. They match it
exactly, character for character.
Docker keeps two storage areas outside the containers: your data, and the key that unlocks every
account you connect. `docker compose down -v` deletes both, permanently. Every account you
connected becomes unreadable, and nothing can recover them. `docker compose down` without `-v` is
safe: it removes the containers and leaves both storage areas alone.
Take a copy of the key: [Back up, export and erase](/operate/backup-and-export). If Postern cannot
open the vault at start-up, it refuses to start rather than starting broken. A database restored
without its key stops there.
**The `VAULT KEY IS NOT BACKED UP` notice.** Postern prints it in its own log at every start. It
is a reminder, not an error, and Postern runs anyway. It appears while Postern holds the key
itself and no marker file sits beside it.
The notice tells you to acknowledge the copy in the Console. **No such control ships.** Nothing in
the Console writes that marker, and no address answers it. So the notice still appears after you
hold a good copy.
Two things stop it. Take your copy of the key first, then choose one.
1. **Write the marker yourself.** Postern looks for a file named `master.key.backed-up` beside the
key. From the folder that holds `docker-compose.yml`:
```bash theme={"system"}
docker compose exec app sh -c \
'date -u +%Y-%m-%dT%H:%M:%SZ > /app/.pci/master.key.backed-up && chmod 600 /app/.pci/master.key.backed-up'
```
Postern checks that the file is there. It never reads what is in it. Write the date anyway. It
tells a later you when you took the copy.
2. **Hold the key yourself.** Put `PCI_MASTER_KEY` in `.env` — a base64 32-byte key you keep —
and restart. Make one with `openssl rand -base64 32`. Set it before the first start. A new key
against accounts encrypted under an old one makes Postern refuse to start.
A restore brings the notice back. The marker sat in the old storage area, and the restore makes a
new one.
Four commands cover the first week. Run them from the same folder:
```bash theme={"system"}
docker compose ps # is it up
docker compose logs -f app # read its log
docker compose stop # pause it; docker compose start resumes
docker compose pull && docker compose up -d # move to a newer image
```
To hold one release instead of the newest, add `POSTERN_VERSION=v0.1.0` to `.env`.
The Console answers at `http://localhost:8787`, and only on the machine Postern runs on.
If Postern runs on the computer in front of you, open
[http://localhost:8787](http://localhost:8787).
If Postern runs on another computer, forward the Console port to your own computer. Run this **on
your own computer**, not on the machine Postern runs on. Turn on SSH on that machine first.
```bash theme={"system"}
ssh -N -L 127.0.0.1:8787:127.0.0.1:8787 YOUR_MACHINE
```
Replace `YOUR_MACHINE` with however you normally reach that computer: a name, a `user@host`, or an
IP address. The terminal then prints nothing and does not return to a prompt. That is the command at
work, not a hang. Leave that window open, use a second terminal window for anything else, and press
**Control-C** when you want to stop. Now open [http://localhost:8787](http://localhost:8787) on your
own computer.
Anyone who can reach the Console port can change your settings and create agent keys. It has no
password, so it stays on this computer. Do not change the address in `docker-compose.yml` to your
network. Do not put a tunnel service in front of it. The full argument is in
[The Console has no authentication](/reference/ports#the-console-has-no-authentication).
The Console opens on a page headed `Your gate is new.` with one button, **Add your first source**.
The left sidebar lists **Gatehouse**, then the six sectors, then **Sources**, **Agents & keys**,
**The ledger** and **Settings**. A sector is one area of your life: finance, mail, calendar,
contacts, health, home. It is the smallest thing you can grant.
To let an agent reach Postern from another device, see [Remote access](/start/remote-access). It is
off by default, and it never moves the Console off this machine.
## Confirm it works
Run these on the machine Postern runs on.
```bash theme={"system"}
docker compose ps
curl -s localhost:8787/healthz
docker volume ls
```
* `docker compose ps` lists `db` and `app` as `running`, and `app` turns `healthy` about 20 seconds
after that.
* `curl -s localhost:8787/healthz` prints `{"status":"ok"}`. The same address in a browser shows the
same thing.
* `docker volume ls` lists two names that end in `pgdata` and `pci_master_key`.
* `.env` sits beside `docker-compose.yml` and holds one line that begins `POSTGRES_PASSWORD=`.
## If something went wrong
| What you see | What to do |
| ------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `docker compose up -d` stops at once and prints `set POSTGRES_PASSWORD in .env — generate one with: openssl rand -hex 24` | `.env` is missing or empty. Run the [step 2](#password) command again, in the folder that holds `docker-compose.yml`. |
| `app` starts and exits within seconds, and your password holds a character that is not a letter or a digit | Run the [step 2](#password) command again, then `docker compose down -v && docker compose up -d`. That wipes the database, which is safe only before you connect anything. |
| `db` is up, `app` cannot sign in to the database, and `.env` changed since the first start | Postgres kept the first password. Put the original line back in `.env`, then run `docker compose up -d`. |
| `app` does not start, and another program on this computer already uses 8787 or 8788 | Move Postern's port. [Step 3](#start) carries the line to add. |
| The browser shows a not-found page while `curl -s localhost:8787/healthz` still answers `{"status":"ok"}` | Postern runs, and its Console files are not where it looked. Run `docker compose logs app`; the log names the folder it tried. Set `PCI_CONSOLE_DIR` in `.env` to the right folder. |
| The log prints `VAULT KEY IS NOT BACKED UP` at every start | That is the reminder, not a fault. [Step 3](#start) has the two ways to stop it. |
## What you have now
Postern runs on a machine you own. Docker downloaded a finished image from
`ghcr.io/getpostern/postern` and built nothing on that machine. There is no Postern account and no
Postern server in the middle. You have connected nothing yet, and no agent can reach anything until
you grant it.
Three things are now yours to keep: the machine, on and updated; the one line in `.env`; and a copy
of the vault key.
## Next
a name, the sectors it opens, a deadline · a few minutes · Postern shows the key once
Tailscale, and Funnel only if a hosted agent needs a public address · about 20 minutes, once ·
off by default
# Set up remote access
Source: https://docs.getpostern.com/start/remote-access
Open two ports to your own devices, and one port to the internet only if claude.ai or ChatGPT needs it.
**Before you start**
* **A Tailscale account, and admin access to Tailscale's admin console.** The free Personal plan covers a household. Sign up at [tailscale.com](https://tailscale.com).
* **Postern installed**, and the Console open in your browser. Step 1 opens it if Postern runs on another computer.
* **About 20 minutes, once.** Postern takes ports 8443 and 10000 on your tailnet. Port 443 goes to the internet only if you do step 4.
* **Your password manager open.** In step 6, Postern shows you an agent key one time only.
* **A Mac or a Linux computer.** Postern runs under Docker, so Windows should work. Nobody has run this page there. In PowerShell, `curl` means something else, so type `curl.exe` in the checks below.
Your tailnet is the private network Tailscale builds between the devices signed
into your account. Nothing else can reach it.
Not every step here is for everyone. Read this first, then do the steps that
apply to you, in order.
| Steps | Who does them |
| ----------- | ------------------------------------------------------------------------------------- |
| **1** | Only you, if Postern runs on a computer you are not sitting at. |
| **2 and 3** | Anyone who wants their own devices to reach Postern. **Most people stop here.** |
| **4 to 6** | Only if claude.ai or ChatGPT must reach Postern. These open one port to the internet. |
None of this is on until you turn it on. [Turn the public port
off](#turn-the-public-port-off) shuts it again whenever you want.
Skip this if you sit at the machine Postern runs on. The Console only answers on
the machine it runs on. Run this on your own computer, not on the machine Postern
runs on:
```bash theme={"system"}
ssh -N -L 127.0.0.1:8787:127.0.0.1:8787 YOUR_MACHINE
```
Replace `YOUR_MACHINE` with however you reach that computer: a name, a
`user@host`, or an IP address. The terminal prints nothing and does not return to
a prompt. That is the command at work, not a hang. Leave that window open, then
open [http://localhost:8787](http://localhost:8787). Press **Control-C** when you
want to stop. [Open the Console](/start/install#open-console) carries the long
version.
A tunnel does not move the Console off that machine:
[port 8787 has no password, and its address stands in for one](/reference/ports#the-console-has-no-authentication).
Install Tailscale on the machine Postern runs on, and on every device you want
to reach it from ([tailscale.com/download](https://tailscale.com/download)).
Sign them all into the same Tailscale account.
On the machine Postern runs on, run `tailscale up`, then follow what it prints
to sign that machine in.
On a Mac, the App Store and desktop builds leave `tailscale` off your PATH, so
`which tailscale` returns nothing. It sits inside the app, with a capital T.
Run this once, in the same terminal:
```bash theme={"system"}
export TS=/Applications/Tailscale.app/Contents/MacOS/Tailscale
```
Then put `$TS` in front of every `tailscale` command below. Close that
terminal and `$TS` is gone. Linux packages put `tailscale` on your PATH.
Two settings in Tailscale's admin console decide whether any address below ever
answers. Turn them on in this order.
HTTPS certificates put this machine's name on the Certificate Transparency
log: a public list of every secure-website certificate ever issued. Anyone can
read it, and entries cannot be removed. Rename the machine to something dull
first, and never treat its name as protection.
Open [login.tailscale.com/admin/dns](https://login.tailscale.com/admin/dns).
Turn on MagicDNS, which lets your devices reach each other by name. Then turn on
HTTPS certificates. Tailscale's own instructions walk both, in that order:
[Enabling HTTPS](https://tailscale.com/kb/1153/enabling-https). Both must be on.
If either is off, the failure is silent: the port never answers, and no log
names the cause.
Get this machine's Tailscale name from `tailscale status` on that machine.
Tailscale's admin console lists it too, on the page its documentation calls
Machines. The name looks like `gateway.example-tailnet.ts.net`, and every
command below needs it.
Never open port 8787, the Console port, whole to any network. Anything that
reaches it holds full control of Postern, and no password stands behind it.
The first command below opens one address on that port and nothing else.
[Reachability is the authentication](/reference/ports#the-console-has-no-authentication).
Run both on the machine Postern runs on:
```bash theme={"system"}
tailscale serve --bg --https=8443 --set-path=/api/ingest http://127.0.0.1:8787/api/ingest
tailscale serve --bg --https=10000 http://127.0.0.1:8788
```
`--bg` keeps Tailscale in the background and gives your prompt back. Without it
the terminal is stuck. Both commands work on Tailscale 1.98.9, and `--set-path`
is current syntax there.
Your own devices now reach two addresses, and the internet reaches neither:
* `https://gateway.example-tailnet.ts.net:8443/api/ingest/` — your iPhone pushes Apple Health data here.
* `https://gateway.example-tailnet.ts.net:10000/mcp` — an agent on your own devices connects here, with an agent key.
Check it from a second computer on your tailnet. It needs Tailscale, the same
account, and a terminal, so a phone will not do. Substitute your own machine
name. This prints only the three-digit answer code:
```bash theme={"system"}
curl -so /dev/null -w '%{http_code}' https://gateway.example-tailnet.ts.net:8443/api/agents
```
It must print **404** — nothing is there, because the first command opened
`/api/ingest` alone. **200** means the whole port is open: stop, and run both
commands again exactly. Nothing at all means MagicDNS or HTTPS certificates is
off ([step 2](#tailscale)).
The second check needs a connection id, and none exists until you press
**Create your ingest endpoint** on the
[Apple Health](/connect/apple-health#create-endpoint) card. Then this must print
**401** — the address answers, and it wants its secret:
```bash theme={"system"}
curl -so /dev/null -w '%{http_code}' https://gateway.example-tailnet.ts.net:8443/api/ingest/
```
Do this only for a hosted agent: an AI app that runs on a company's servers, like
claude.ai or ChatGPT. It can never reach your home network on its own, and it
connects out on port 443 only. Open 443, pointed at port 8788, the agent port.
Never point it at 8787.
Your tailnet policy must let this machine run a funnel. Tailscale keeps that
policy in its admin console, on the page its documentation calls Access
controls. Tailscale's own instructions cover the funnel permission:
[Tailscale Funnel](https://tailscale.com/kb/1223/funnel). Scope the permission to
this machine's own tag, never to the whole tailnet. `serve` and `funnel` are
last-command-wins per port. A mistyped command on any machine that holds the
permission can open something to the internet
([the whole argument](/reference/ports#reaching-postern-from-another-network)).
This page does not walk Tailscale's policy file. If the permission is not there,
the command below refuses out loud and prints a link that turns it on. Open that
link, then run the command again.
Run the command below once, and get it right first time. Repeated `serve` and
`funnel` commands re-issue certificates, and the free certificate service
limits how often it will issue one for a name. Past that limit you lose your
own hostname for hours. Retry in [step 5](#probe-outside), never here.
One check before the command: run `tailscale serve status` and read what this
machine already serves. The line that shows the machine's name with no port after
it is the 443 slot — the slot the command below takes. Another program may hold
it already. [OpenClaw](https://docs.openclaw.ai/gateway/tailscale), for example,
can put its own dashboard there, and many people run it on the same machine as
Postern. Because `serve` and `funnel` are last-command-wins per port, the command
below takes the slot and the program that held it stops answering — with no
error to that program. Postern cannot take a different slot: a hosted agent
connects out on 443 only. So move the other program to another port first, in
that program's own settings, and run `tailscale serve status` again to confirm
the 443 slot is free. The two run side by side on one machine once each holds
its own port.
```bash theme={"system"}
tailscale funnel --bg --https=443 http://127.0.0.1:8788
tailscale funnel status
```
In `tailscale funnel status`, the 443 line must read `(Funnel on)`, and every
other line `(tailnet only)`.
Now tell Postern its address. In the Console, click **Settings** in the left
sidebar, then find **Remote access**. In the row headed **Public · the address
this gate answers on**, press **Set the address…**.
A field labelled **Your gate’s public address** appears, with the placeholder
`https://your-mac.tailnet.ts.net`. Type `https://` and this machine's Tailscale
name, with nothing after it — not the `/mcp` address you hand an agent. Postern
builds that one itself, and it refuses an address that carries a path.
Postern does not save the address until you confirm it. Press **Publish this
gate** on the bar headed **Publish this gate to the public internet?**. That bar
lists what it costs you. The row then reads **restart to apply**, and a message
reads `Saved — restart the gateway to start publishing.`
Restart Postern from the folder that holds `docker-compose.yml` — the `postern`
folder you made in [Install Postern](/start/install):
```bash theme={"system"}
cd postern
docker compose restart app
```
The restart is not optional: Postern reads the address once, at start-up. The
**Public** row then reads **published**, and the **OAuth bridge** row reads
**On — published at** your address. That bridge is on exactly when Postern has
an address, and off otherwise. There is no separate switch.
A device on your tailnet cannot prove this: from inside, a funnel and a private
serve look identical. Use a device off your tailnet that can run these commands
— a laptop on a phone's cellular hotspot does it. Substitute your own machine
name. All three must print **200**, **401** and **404**, in that order:
```bash theme={"system"}
curl -so /dev/null -w '%{http_code}' https://gateway.example-tailnet.ts.net/.well-known/oauth-protected-resource/mcp
curl -so /dev/null -w '%{http_code}' https://gateway.example-tailnet.ts.net/mcp
curl -so /dev/null -w '%{http_code}' https://gateway.example-tailnet.ts.net/api/agents
```
200 means it answered. 401 means it answered and wants a key. 404 means nothing
is there. On the third line that is the answer you want: the Console port did
not come with it. Touch no agent app until all three read correctly.
claude.ai remembers what it found here for about five minutes, failures
included. Change one thing, wait five minutes, then try once.
First create the key. In the Console, click **Agents & keys** in the left
sidebar, then click **Mint a key**. Three fields:
* **Name** — what you will call this agent.
* **Grant which sectors** — six areas of your life: finance, mail, calendar, contacts, health, home. The form says `Nothing is granted until you pick it.`
* **Expires** — four chips: **Never**, **30 days**, **60 days** and **90 days**. Once you have set a public address, the form starts on **90 days**.
[Mint your first key](/start/first-key) walks the whole form.
Pick anything but **Never**. Postern refuses a key with no expiry at the hosted
sign-in page: `This agent key never expires. Keys used with a cloud client must
have an expiry — mint or rotate a key with a 30/90/365-day expiry in the
Console, then try again.` The Console has no 365-day chip, and **90 days** is
its longest. **Never** dead-ends you at the last step of this page.
Press **Mint the key**. A screen headed **Agent key — shown once** appears, with
a **Copy** button. Copy the key into your password manager now. Postern cannot
show you this key again. It keeps a scrambled copy it can check against, never
the key itself. Lose it and you create another.
The next **Copy** button replaces whatever is on your clipboard — the agent key
too. Store the key first.
The address you hand the agent is your published address plus `/mcp`. The
Console prints the exact value under **Agents & keys** → **Set up the bridge →**,
with its own **Copy** button.
In claude.ai, open its settings and find its connectors. Add a connector of your
own. Paste the address into it. If it asks for a client id or a client secret,
leave both empty. Postern issues neither.
claude.ai then sends you to a page your own Postern serves, headed **Authorize
agent access**. Paste the agent key under **Paste an agent key from the Console**.
Press **Approve**. claude.ai holds a token that rotates from then on. ChatGPT
takes a longer path: [Connect ChatGPT](/connect/chatgpt).
[Revoke a key and every token made from it dies with it](/reference/agent-keys#revoking-rotating-and-removing).
Postern denies the agent's next call.
## Turn the public port off
This is not a step. It undoes [Open one port to the internet](#publish), whenever
you want that port shut again. Nothing here touches your own devices.
Three acts. Do all three. Any two leave you half-off — a funnel with no address,
an address with no funnel, or Postern still on the old one.
On the machine Postern runs on:
```bash theme={"system"}
tailscale funnel --https=443 off
```
In the Console, click **Settings**, then find **Remote access**. In the
**Public** row, press **Stop publishing…**, then press **Stop publishing** on
the bar headed **Stop publishing this gate?**. A message reads
`Stopped — it stays reachable until the gateway restarts.`
If `.env` on the machine Postern runs on holds an `MCP_PUBLIC_URL` line, the
Console refuses, and says so: `The box publishes this gateway: MCP_PUBLIC_URL
is set in its environment, and the box wins over anything saved here.` Delete
that line from `.env` first. `.env` is the settings file beside
`docker-compose.yml`.
Then restart:
```bash theme={"system"}
cd postern
docker compose restart app
```
Confirm no funnel remains. The output must contain no `AllowFunnel` anywhere:
```bash theme={"system"}
tailscale serve status --json
```
Nothing about [Open two ports to your own devices](#your-devices) changes. Your own
devices still reach Postern.
## Confirm it works
* Tailscale's admin console → DNS: MagicDNS on, HTTPS certificates on.
* From a second computer on your tailnet, `/api/agents` on port 8443 prints **404**.
* `tailscale funnel status`: the 443 line reads `(Funnel on)`, every other line `(tailnet only)`.
* Console → Settings → Remote access: the **Public** row reads **published**, not **restart to apply**.
* Console → Settings → Remote access: the **OAuth bridge** row reads **On — published at** your address.
* From a device off your tailnet, the three checks in [step 5](#probe-outside) print **200**, **401** and **404**.
* Console → **Agents & keys** lists your key, and its sub-line reads `expires in 30d`, `expires in 60d` or `expires in 90d` — never `never expires`.
## If something went wrong
| What you see | What to do |
| ---------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| The port never answers, and nothing in any log says why | MagicDNS or HTTPS certificates is off. Turn both on at [login.tailscale.com/admin/dns](https://login.tailscale.com/admin/dns). |
| `which tailscale` returns nothing, on a Mac | Run `export TS=/Applications/Tailscale.app/Contents/MacOS/Tailscale`, then put `$TS` in front of every `tailscale` command. |
| `curl` prints a web page instead of three digits, on Windows | In PowerShell, `curl` means something else. Type `curl.exe` instead. |
| `/api/agents` answers 200 from your tailnet | Port 8787 is open whole. Run both commands in [step 3](#your-devices) again, exactly as written. |
| The **Public** row still reads **off** after you typed the address | Postern saves the address only when you press **Publish this gate** on the confirmation bar ([step 4](#publish)). |
| The **Public** row reads **restart to apply** | Postern reads the address only at start-up. Run `docker compose restart app` from the folder that holds `docker-compose.yml`. |
| A hosted agent says it could not reach you, and your logs show nothing | The funnel is on a port other than 443, so the request never reaches you. Run `tailscale funnel status`; the 443 line must read `(Funnel on)`. |
## What you have now
| If you stopped after | What can reach Postern |
| ------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [step 1](#ssh-tunnel) | Nothing is open. The Console reaches your computer through the SSH tunnel, and nowhere else. |
| [step 3](#your-devices) | Your own devices reach two addresses on your tailnet. The internet reaches nothing. |
| [step 6](#connect-agent) | The internet reaches eight addresses on one port. Seven are the sign-in machinery and hold no data of yours; the eighth is `/mcp`, which needs a key. The Console is not among them. [The full list](/reference/oauth-bridge#what-the-internet-reaches). |
Three costs stay with you:
* a public hostname in a permanent certificate log
* a Tailscale account to keep
* an address that stays live until you [turn it off](#turn-the-public-port-off)
## Next
a ChatGPT paid plan + a published address · about 10 minutes, once · witnessed end-to-end 2026-08-01
Health Auto Export on your iPhone · about 10 minutes · push, not pull
# Set up with an agent
Source: https://docs.getpostern.com/start/set-up-with-an-agent
Point a coding agent at one file and it installs Postern for you — you keep the sign-ins and the secrets.
You do not have to walk the install pages yourself. If you use a coding agent — Claude Code,
Cursor, Codex, or any tool that can read files and run commands — point it at one file and say:
> Follow this file and set Postern up for me.
The file is
[`setup-with-your-agent.md`](https://raw.githubusercontent.com/getpostern/postern/main/setup-with-your-agent.md),
at the root of the [Postern repository](https://github.com/getpostern/postern). Give your agent
that address, or the local copy if you cloned the repository.
## What the agent does, and what stays yours
The agent does every step a program can do: it installs Docker if the machine has none (it asks
first), fetches the compose file, starts the gateway, and verifies each connection after you
make it. It stops and tells you what is needed at every step only you can do.
Yours are the sign-ins and the secrets. You sign in to each provider yourself, and you paste
every password, token, and key into Postern's own screens — the file forbids the agent to take
them through the chat.
Honestly stated: an agent can do about 95% of getting Postern running and connected to itself,
and about half of connecting it to your life. The slow parts — provider sign-ins, developer
consoles — stay human.
The file was executed end to end on a clean machine by a first-time user on 2026-08-08, and the
lessons of that run are folded into it.
## If you would rather do it by hand
The same path, written for people screen by screen, starts at [Install](/start/install). The
agent file leans on these pages rather than repeating them, so the two never disagree.