stories · Portona

A key cabinet for agents and tools

Every automated job a school runs needs keys: to the timetable, the student system, the email service. Portona hands a job only the keys it needs, only after it proves who it is, and keeps a record of every handout.

stage
prototype
for
the people who run a school's automated jobs, and the leaders who answer for them
started
28 November 2026
latest milestone
2 December 2026

01 / the story

what it's for

the problem

Schools run more automated jobs than most people realise. A nightly sync puts the timetable into staff calendars. A script sends results to the reporting system. Increasingly, an AI agent builds and tests a tool. Each of them needs keys: a password or token for the systems it talks to.

The usual answer is to paste the key into wherever the job runs, and leave it there. It works, until the key turns up in a log file, or outlives the person who set it up by three years, and nobody can say which jobs used it or when.

I build a lot with AI agents now, in short-lived cloud sandboxes. I didn't want to give any of them a key that would still work next year.

who it's for

The people who run a school's automated jobs, first. Then the technology and business leaders who have to answer two questions with confidence: who can use this key, and when did they?

what it does

  • A job proves who it is. The platform it runs on (an Amp sandbox or a GitHub workflow) gives it a token that lasts about a minute.
  • Portona checks the rules. The rules live in code and change only through a reviewed change, like anything else that matters.
  • It hands over only what's named. Just the secrets that job is allowed, for that run, and nothing it didn't ask for.
  • Everything is recorded. Every handout and every change goes in an audit log, with names but never values.

where it's up to

It's a prototype: documented, released and reviewed, but not yet looking after a school's keys.

How Portona works: a workload trades a token for secrets, checked against rules kept in a deployment repository
How Portona works: a workload trades a token for secrets, checked against rules kept in a deployment repository

02 / evolution

how it's evolved

10 milestones, 28 nov to 2 december 2026.

  1. 01

    a token in, secrets out

    The first working version. A job running in a cloud sandbox proves who it is with a token that lasts 60 seconds, and Portona returns the secrets its rules allow. Each token works once. Every refusal looks the same, so a probe learns nothing.

    release notes ↗
    Portona's architecture: workload, Worker, Access, D1 and R2
    Portona's architecture: workload, Worker, Access, D1 and R2
  2. 02

    an admin page you can't read secrets from

    A page for setting and replacing secrets, behind Cloudflare Access, styled in the same Braun-inspired language as Outlearn. Values are write-only: no screen or response ever shows one again. Daily encrypted backups, a restore tool and a maintenance switch arrived the same hour.

    release notes ↗
    The admin page: a stat strip over each bundle's secrets, with versions and who changed them
    The admin page: a stat strip over each bundle's secrets, with versions and who changed them
  3. 03

    it fits on a phone

    If something goes wrong at 10pm, the person on call is holding a phone. The sidebar becomes a switcher and the tables stack.

    release notes ↗
    Portona's admin page on a phone
    Portona's admin page on a phone
  4. 04

    replace a secret in place

    Rotating a key is the job people put off, so it should be one action. Each secret gets a replace button that asks only for the new value.

    release notes ↗
    The same rows in v0.2.0, with delete onlySecret rows with replace and delete actions
    before: The same rows in v0.2.0, with delete only · after: Secret rows with replace and delete actions
  5. 05

    a second kind of job: GitHub Actions

    Jobs in GitHub's automation can now ask too, but only if the rule pins the exact repository, branch, workflow file and event. A pull request from outside can never match.

    release notes ↗
    The docs: a GitHub Actions job pinned to its branch, environment and workflow
    The docs: a GitHub Actions job pinned to its branch, environment and workflow
  6. 06

    environments, grants and expiry dates

    Rules now name environments, such as an app's staging and production, and grants to them. A grant can be narrowed to particular secrets, given an end date, and must carry a note saying why it exists.

    release notes ↗
    Production and staging environments with their secrets and grants
    Production and staging environments with their secrets and grants
  7. 07

    a release that only fixed the docs

    Two reviews found the instructions told people to run a command in a way that could hand a token to an impostor package. No code was wrong, but the docs were, so they got a release of their own.

    release notes ↗
    Release notes for v0.4.1, which changed only the docs
    Release notes for v0.4.1, which changed only the docs
  8. 08

    names can't be quietly reused

    If someone renamed an environment, or deleted one and made a new one with the old name, it would have inherited the old secrets. Portona now remembers which name belongs to which environment, refuses a mismatch, and says how to retire a name on purpose.

    release notes ↗
    An environment refused because its name now belongs to a different ID
    An environment refused because its name now belongs to a different ID
  9. 09

    a key for the keys, held by people

    A wrapping key gives each environment its own encryption key. Its only backup is locked to the team's own keys and committed to the repository before the key is ever used, so there's always a way back that doesn't depend on one person.

    release notes ↗
    The master key view in v0.2.0, before the wrapping keyThe keys view: master keys in use and the wrapping key's id
    before: The master key view in v0.2.0, before the wrapping key · after: The keys view: master keys in use and the wrapping key's id
  10. 10

    moving every secret under its environment's own key

    Over three releases, existing secrets moved under each environment's own key: copied a few at a time, never over a newer change, and read only once an environment is fully copied. Backups now hold those keys in one consistent snapshot, and a read-only check reports a fingerprint for every secret, so a restore can be compared row by row without anyone seeing a value.

    release notes ↗

03 / the detail

how it was built

how I built it

It runs on Cloudflare, with secrets encrypted in its database. I built it over five days with AI agents, in fifteen releases, each with a changelog entry and screenshots. That habit is what made this story easy to tell: the evolution below is the record.

A few decisions worth explaining:

Rules in code, not a settings screen. Who can fetch what is the most sensitive decision in the system, so it gets the same review as any other change, and the history says who changed it and why.

Write-only secrets. Once a secret is set, no page shows it again. Replace it, don't read it.

Plan for the bad day. Backups, a tested restore, and a maintenance switch that a database restore can't accidentally turn off.

Reviews before releases. Most releases followed an independent review, and one release fixed nothing but the documentation, because the docs were where the risk was.

a question for schools

How many keys does your school have pasted into places where they'll outlive the person who put them there? Portona is one answer. The bigger one is treating keys as something you hand out briefly and record, not something you leave lying around.