Skip to main content

Agience Origin

PyPI Python License CI

Identity, authority.

Origin says who. It is the identity and authorization authority — the trust anchor the rest of the system verifies against, and the entity everything else asks "who is this, and may they?"

As the OIDC issuer it mints and verifies tokens, publishes the JWKS that peer services check signatures against, and owns the passkey/OTP account and setup flows.

The shared foundation is agience-prism-py — Origin's only workspace dependency.

Layout

Path Purpose
src/origin/ The FastAPI service: api/, routers/, services/ (auth, verifier, key custody via Shamir + key-oracle), models/, db/, scripts/ (operator commands), plus alembic/ (migrations) and tests/.
src/origin/web/ The static auth UI (login / passkey / setup), served at /, /login, /account, /reset-password and /verify-email, and mounted for its assets at /web.

web/ lives inside the package, beside the module that serves it. main.py resolves it as Path(__file__).resolve().parent / "web", which gives one answer in both places the code runs: a checkout and an installed distribution. A path that climbs out of the package resolves against the repository layout, which only a checkout has. src/origin/tests/test_the_package_ships_what_it_serves.py holds it there.

Running it

Origin is an ordinary Python package. It needs no container, and installing it pulls its own pinned dependencies:

pip install ../agience-prism/py          # the trust floor
pip install .                            # or -e ".[test]" to work on it
KEYS_DIR=/path/to/keys python -m uvicorn origin.main:app --host 127.0.0.1 --port 8080

It applies its own migrations at startup, so the first boot creates the database. Requires Python 3.11 or newer.

Bind loopback and put a reverse proxy in front for anything public. A service on the public interface answers past whatever header and path rules the proxy applies.

KEYS_DIR must already contain origin.private.pem, origin.public.pem, encryption.key and inbound_nonce.secret. Origin ships no key generator — every loader in prism.trust.key_manager raises rather than inventing a key it did not write, which is correct for an authority and means an empty directory is a hard stop. Key material comes from the platform installer (agience-observe), a KMS, or a one-shot key-init step. .env.example documents the full set.

For a managed install, agience-observe/package/manager does all of the above: it finds a Python, builds the virtualenv, installs Origin into it and supervises the process.

Letting a peer verify Origin

Publishing /.well-known/jwks.json is not what makes a peer able to verify an Origin-signed token. Agience peers read their trust inline, from trust_anchors in the authority.manifest.json of their own keyset, and never fetch. Until Origin's public JWK is physically present there under trust_anchors.origin, two healthy, mutually reachable services answer 401 for every user token and nothing logs a reason: from the peer's side there is no mismatch, there is simply no such issuer.

A peer's own key init writes only its own anchor — asserting a public key for a service whose private key is elsewhere is a trust statement, not a convenience. Origin emits its half:

origin-emit-anchor                                   # the mergeable fragment
origin-emit-anchor --format anchor --uri https://origin.example.com
origin-emit-anchor --format jwks --keys-dir /path/to/keys
python -m origin.scripts.emit_trust_anchor           # no install needed

--format chooses fragment (a mergeable {"trust_anchors": {"origin": …}}, the default), anchor (the value alone, for placing at trust_anchors.origin), or jwks (the JWKS alone). --keys-dir defaults to $KEYS_DIR, and --uri to config.AUTHORITY_ISSUER.

It reads KEYS_DIR/origin.public.pem, produces the JWK through the same get_jwk_public() that serves /.well-known/jwks.json — so what you place is byte-identical to what Origin publishes, kid included — and writes nothing. Placement is the operator's decision; a command that installed trust in itself on a peer would be the one direction a trust anchor must never travel.

To place it, merge into the peer's manifest:

origin-emit-anchor --format anchor > /tmp/origin-anchor.json
python - <<'EOF'
import json, pathlib
m = pathlib.Path("/path/to/peer/keys/authority.manifest.json")
doc = json.loads(m.read_text())
doc.setdefault("trust_anchors", {})["origin"] = json.load(open("/tmp/origin-anchor.json"))
m.write_text(json.dumps(doc, indent=2) + "\n")
EOF

Then restart the peer. A wrong kid or a re-encoded modulus fails as the same silent 401, which is why the JWK is emitted rather than transcribed.

Configuration

.env.example is the template — copy it to .env. It states the in-code default for every value and warns where an unset variable is itself a decision: KEYS_DIR unset means the process does not boot, and ORIGIN_ALLOWED_ORIGINS unset derives the CORS allow-list from the issuer, ORIGIN_URI and the facet bases rather than falling back to a wildcard.

License

Dual-licensed: AGPL-3.0-only or commercial. See LICENSE and NOTICE; commercial and white-label terms in COMMERCIAL_LICENSE.md. Contributing: CONTRIBUTING.md and CLA.md.

Star History

Star History Chart

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

agience_origin-0.1.3.tar.gz (605.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

agience_origin-0.1.3-py3-none-any.whl (653.0 kB view details)

Uploaded Python 3

File details

Details for the file agience_origin-0.1.3.tar.gz.

File metadata

  • Download URL: agience_origin-0.1.3.tar.gz
  • Upload date:
  • Size: 605.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for agience_origin-0.1.3.tar.gz
Algorithm Hash digest
SHA256 13bc6dbe6f0207ffc76cffa335ecc35968267f6417faab56793b546d120543ac
MD5 2dc313fb8d62d9c2a8db5816eaed5a9a
BLAKE2b-256 d75359832b07b559c022fd50a0df6c45ca2b42bf043af0c8f2d97d9126c69806

See more details on using hashes here.

Provenance

The following attestation bundles were made for agience_origin-0.1.3.tar.gz:

Publisher: publish.yml on Agience/agience-origin

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file agience_origin-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: agience_origin-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 653.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for agience_origin-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 42e31877937c625b0dee96e7bf763400e5de4b2fd1a1f1bc452b97cc0d2baf76
MD5 ac330988bbe9c9859972bcc9c9048bc5
BLAKE2b-256 63bdc914cad9bbb828d5f60a23a409bb5a5cbae768b5dd58475dbc2b5f3105b8

See more details on using hashes here.

Provenance

The following attestation bundles were made for agience_origin-0.1.3-py3-none-any.whl:

Publisher: publish.yml on Agience/agience-origin

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.1.3 This release

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page