# Edge and proxy reference

Docs. Breadcrumb: [Home](https://osty.dev/) / [Docs](https://osty.dev/docs) / Edge and proxy reference

`osty-edge` and `osty-proxy` are the two source-available daemons that run inside your VPC. `osty-edge serve` pins `.osty/policy.yaml`, keeps the signed edge cache and dials out to the control plane. `osty-proxy serve` fronts npm, PyPI, Go, OCI, Cargo and Maven registries and holds every unvetted pull when the policy fails closed.

Table: The two daemons and what happens when something is missing

| Daemon | Start it with | Default listen | When input is missing |
| --- | --- | --- | --- |
| `osty-edge` | `osty-edge serve --policy <path>` | `127.0.0.1:8082` | Refuses to start without a valid policy, exit 2. |
| `osty-proxy` | `osty-proxy serve --org-id <uuid> --signing-key <pem>` | `127.0.0.1:8083` | Refuses to start without both unless `--dev`, exit 2. |
| Both | `osty-edge policy validate <path>` | None | The edge binary carries the same policy validator as `osty`. |

Run a local proxy against npm:

```bash
osty-proxy serve --dev --policy .osty/policy.yaml --listen 127.0.0.1:8083 --npm-upstream https://registry.npmjs.org
```

## How do osty-edge and osty-proxy fit together?

Both daemons read the same pinned policy and the same SQLite edge cache. `osty-edge` writes into the cache: signed verdicts, namespace batches, the pinned policy snapshot and kill switch freezes from the control plane. `osty-proxy` reads the cache on every pull and signs each decision with its own Ed25519 key.

The [`osty-edge` Helm chart](https://osty.dev/integrations/kubernetes) runs them as two containers in one pod that share `/var/lib/osty/edge-cache.sqlite`. Nothing accepts inbound connections from Osty's cloud. The edge dials out to `osty-control` over mTLS.

Table: Health and status endpoints

| Daemon | Path | Returns |
| --- | --- | --- |
| Both | `GET /healthz` | Liveness: service, version and `ok`. |
| Both | `GET /readyz` | Readiness checks: the pinned policy on the edge, the cache on the proxy. |
| `osty-edge` | `GET /v1/collectors` | Whether collectors are configured, and each source's status. |
| `osty-edge` | `GET /v1/namespace-sync` | Private namespace sync status. |

## osty-edge serve

Without `--control-url` the edge runs offline. It pins the policy, recovers interrupted commands from the cache and serves health endpoints. With `--control-url` it opens the EdgeControlService stream, executes signed commands only when the pinned policy allows them, and can run collectors and accept `osty-sensor` reports.

Table: Flags for `osty-edge serve`

| Flag | Value | Default | What it does |
| --- | --- | --- | --- |
| `--policy` | path | `$OSTY_POLICY_PATH` | Git-pinned fleet policy. Required. |
| `--listen` | host:port | `127.0.0.1:8082`, or `$OSTY_LISTEN_ADDRESS` | Health endpoint address. |
| `--cache-path` | path | `$OSTY_EDGE_CACHE_PATH`, else in-memory | SQLite edge cache. |
| `--control-url` | URL | `$OSTY_CONTROL_URL` | Outbound control plane URL. Unset means offline. |
| `--edge-id` | string | `osty-edge`, or `$OSTY_EDGE_ID` | Stable identifier for this edge. |
| `--tls-ca` | PEM path | `$OSTY_TLS_CA` | CA for the mTLS control plane stream. |
| `--tls-cert` | PEM path | `$OSTY_TLS_CERT` | Client certificate for the stream. |
| `--tls-key` | PEM path | `$OSTY_TLS_KEY` | Client private key for the stream. |
| `--runtime-config` | path | `$OSTY_EDGE_RUNTIME_CONFIG` | Runtime YAML for forge, CI, Kubernetes, cloud collectors, namespace sync, observability, operator keys and the offline ledger. A `collectors` block needs `--control-url`. |
| `--sensor-socket` | path | `$OSTY_EDGE_SENSOR_SOCKET` | Unix socket for `osty-sensor` reports from this node. Needs `--control-url`. |
| `--sensor-token-file` | path | `$OSTY_EDGE_SENSOR_TOKEN_FILE` | Bearer token `osty-sensor` presents on the socket. |
| `--sensor-listen` | host:port | `$OSTY_EDGE_SENSOR_LISTEN` | mTLS listener for sensor reports from other nodes. Needs `--control-url` and the `--sensor-tls-*` flags. |
| `--sensor-tls-ca` | PEM path | `$OSTY_EDGE_SENSOR_TLS_CA` | CA that must have issued every sensor client certificate. |
| `--sensor-tls-cert` | PEM path | `$OSTY_EDGE_SENSOR_TLS_CERT` | Server certificate for `--sensor-listen`. |
| `--sensor-tls-key` | PEM path | `$OSTY_EDGE_SENSOR_TLS_KEY` | Private key for `--sensor-tls-cert`. |
| `--sensor-flush-interval` | duration | `30s` | How often queued sensor reports are forwarded. |
| `--sensor-max-pending-hosts` | integer | 4096 | Hosts that may await forwarding before the edge answers 503. |

Run the edge offline and check readiness:

```bash
osty-edge serve --policy .osty/policy.yaml --cache-path /var/lib/osty/edge-cache.sqlite --listen 127.0.0.1:8082
curl -s http://127.0.0.1:8082/readyz
```

`/readyz` once the policy is pinned:

```json
{"service":"osty-edge","version":"dev","status":"ok","checks":{"policy":{"status":"ok"}}}
```

Connected to the control plane, as the Helm chart runs it:

```bash
osty-edge serve \
  --policy /etc/osty/policy/policy.yaml \
  --cache-path /var/lib/osty/edge-cache.sqlite \
  --control-url https://control.osty.example.com \
  --edge-id edge-prod-eu1 \
  --tls-ca /etc/osty/control-tls/ca.crt \
  --tls-cert /etc/osty/control-tls/tls.crt \
  --tls-key /etc/osty/control-tls/tls.key \
  --runtime-config /etc/osty/runtime/edge-runtime.yaml
```

## osty-proxy serve

`osty-proxy` is a caching registry firewall. Point package managers at it, and it allows a pull only when the edge cache holds a verdict the policy accepts, or when the policy fails open for that origin. Outside `--dev`, it refuses to start without `--org-id` and `--signing-key`, so every block is signed and recorded in the offline Evidence Ledger.

Table: Flags for `osty-proxy serve`

| Flag | Value | Default | What it does |
| --- | --- | --- | --- |
| `--listen` | host:port | `127.0.0.1:8083`, or `$OSTY_LISTEN_ADDRESS` | Proxy listen address. |
| `--cache` | path | `$OSTY_EDGE_CACHE` | SQLite edge cache shared with `osty-edge`. |
| `--policy` | path | `$OSTY_POLICY_PATH` | Fleet policy. Without it the proxy fails closed and blocks `CONFIRMED_MALICIOUS` and `QUARANTINED_HIGH_RISK`. |
| `--origin` | `prod-ci` or `dev-laptop` | `prod-ci`, or `$OSTY_PROXY_ORIGIN` | Origin floor for this instance. |
| `--org-id` | UUID | `$OSTY_ORG_ID` | Organisation that owns the offline ledger. Required outside `--dev`. |
| `--signing-key` | PEM path | `$OSTY_PROXY_SIGNING_KEY` | Ed25519 key that signs decisions and ledger entries. Required outside `--dev`. |
| `--signing-key-id` | string | `edge-proxy`, or `$OSTY_PROXY_SIGNING_KEY_ID` | Key ID published with signed decisions. |
| `--edge-id` | string | `osty-proxy`, or `$OSTY_EDGE_ID` | Edge identifier on offline audit entries. |
| `--dev` | bool | false, or `$OSTY_PROXY_DEV=true` | Allow an ephemeral signing key and no organisation, for local use. |
| `--npm-upstream` | URL | `$OSTY_NPM_UPSTREAM` | Upstream npm registry. |
| `--pypi-upstream` | URL | `$OSTY_PYPI_UPSTREAM` | Upstream PyPI registry. |
| `--go-upstream` | URL | `$OSTY_GO_UPSTREAM` | Upstream Go module proxy. |
| `--oci-upstream` | URL | `$OSTY_OCI_UPSTREAM` | Upstream OCI registry. |
| `--cargo-upstream` | URL | `$OSTY_CARGO_UPSTREAM` | Upstream Cargo sparse index. |
| `--cargo-download-upstream` | URL | `$OSTY_CARGO_DOWNLOAD_UPSTREAM` | Upstream `.crate` download base. |
| `--maven-upstream` | URL | `$OSTY_MAVEN_UPSTREAM` | Upstream Maven repository. |
| `--public-url` | URL | `$OSTY_PROXY_PUBLIC_URL`, else the request host | Base URL written into rewritten npm tarball links and the Cargo index config. |
| `--blob-dir` | directory | `$OSTY_PROXY_BLOB_DIR` | Local blob cache for allowed artifacts. |
| `--cache-read-connections` | 1 to 64 | `min(max(GOMAXPROCS,4),16)`, or `$OSTY_PROXY_CACHE_READ_CONNECTIONS` | Read-only SQLite connections for verdict lookups. |
| `--block-dedup-window` | 1s to 1h | `1m0s`, or `$OSTY_PROXY_BLOCK_DEDUP_WINDOW` | Collapses repeated identical blocks into one ledger entry plus a hit count. |
| `--rpc-token-file` | path | `$OSTY_PROXY_RPC_TOKEN_FILE` | Bearer token for RegistryPolicyService. The endpoint is off when unset. |
| `--kev-waiver-dir` | directory | `$OSTY_PROXY_KEV_WAIVER_DIR` | Signed KEV cooldown waivers to enforce. Needs `--operator-key` and `--org-id`. |
| `--operator-key` | `key-id=operator-id=path` | none | Trusted operator key for waivers. Repeatable. |

A local proxy for npm in development mode:

```bash
osty-proxy serve --dev --policy .osty/policy.yaml --listen 127.0.0.1:8083 --npm-upstream https://registry.npmjs.org
npm install left-pad@1.3.0 --registry http://127.0.0.1:8083/npm/
```

A production proxy for every supported ecosystem:

```bash
osty-proxy serve \
  --listen 0.0.0.0:8083 \
  --cache /var/lib/osty/edge-cache.sqlite \
  --policy /etc/osty/policy/policy.yaml \
  --signing-key /etc/osty/proxy-signing/key.pem \
  --signing-key-id edge-proxy \
  --org-id 7f9c0c56-7a8e-4f4b-9d55-1f9f1d1c2e3a \
  --edge-id edge-prod-eu1 \
  --origin prod-ci \
  --blob-dir /var/cache/osty/proxy-blobs \
  --npm-upstream https://registry.npmjs.org \
  --pypi-upstream https://pypi.org \
  --go-upstream https://proxy.golang.org \
  --oci-upstream https://registry-1.docker.io \
  --cargo-upstream https://index.crates.io \
  --cargo-download-upstream https://static.crates.io/crates \
  --maven-upstream https://repo.maven.apache.org/maven2
```

Table: Registry routes served by `osty-proxy`

| Path prefix | Serves | Upstream flag |
| --- | --- | --- |
| `/npm/` | npm packuments and tarballs | `--npm-upstream` |
| `/pypi/` | PyPI simple index and files | `--pypi-upstream` |
| `/go/` | Go module proxy protocol | `--go-upstream` |
| `/cargo/` | Cargo sparse index and `.crate` downloads | `--cargo-upstream`, `--cargo-download-upstream` |
| `/maven/` | Maven repository layout | `--maven-upstream` |
| `/v2/` | OCI distribution manifests and blobs | `--oci-upstream` |
| `/` | npm at the root, when `--npm-upstream` is set | `--npm-upstream` |
| `/admission/validate` | Kubernetes admission review of workload images | None |

## How does osty-proxy fail closed?

1. A public package whose name collides with a private namespace from the signed namespace batches is blocked as dependency confusion.
2. An artifact frozen by the kill switch is blocked.
3. A cached signed verdict decides next: `CONFIRMED_MALICIOUS` is blocked, and any verdict in `supplyChain.blockVerdicts` is blocked or held.
4. With no verified verdict, `supplyChain.proxyFailureMode` for the request's origin decides. `FAIL_CLOSED` holds the pull with HTTP 403. `FAIL_OPEN_WITH_CACHE` lets it through.

The origin can only get stricter. An instance started with `--origin prod-ci` treats every request as production CI. A `dev-laptop` instance treats a request as production CI when it sends `X-Osty-Origin: prod-ci`, so a CI job can ask for the stricter mode but never the looser one.

A held pull under `FAIL_CLOSED`, with the signed justification trimmed:

```text
HTTP/1.1 403 Forbidden
X-Osty-Decision: PULL_DECISION_QUARANTINE_HOLD
X-Osty-Verdict: SUPPLY_CHAIN_VERDICT_UNSPECIFIED

{"decision":"PULL_DECISION_QUARANTINE_HOLD","verdict":"SUPPLY_CHAIN_VERDICT_UNSPECIFIED","package":"left-pad","version":"1.3.0","reasons":["no verified verdict in local cache; policy failure mode FAIL_CLOSED blocks unvetted pull"],"policy_digest":"sha256:87433aefdeae2d0b8d61cfe0ed7523a82977299520fed2aaa72b1f74b1942fe7","signing_key_id":"edge-proxy",...}
```

Startup refusals, each exit 2:

```text
osty-edge serve: usage error: --policy or OSTY_POLICY_PATH is required
osty-proxy serve: usage error: --org-id is required so offline proxy blocks are recorded in the evidence ledger (use --dev for local development)
osty-proxy serve: usage error: --origin must be prod-ci or dev-laptop, got "qa"
```

## How does the kill switch reach the proxy?

The control plane sends a freeze command over the edge stream. `osty-edge` checks it against the locally pinned policy and refuses it when `killSwitch.autoFreezeProxyOnConfirmedMalicious` is false. Otherwise it writes the freeze into the shared cache, and the next pull through `osty-proxy` is blocked with the reason `artifact is frozen by emergency kill switch`.

- Rollback of stateless workloads follows `killSwitch.autoRollbackStatelessWorkloads`. Stateful workloads follow `killSwitch.statefulMigrationAction`.
- When `killSwitch.requireDualControlForBroadRollback` is true, a broad rollback needs two operators to run `osty dual-control sign`, and the edge verifies both signatures itself.
- Release gates and freeze windows never block a kill switch, an artifact freeze or containment.

## Frequently asked questions

### Do I need osty-edge to run osty-proxy?

No. `osty-proxy` runs on its own against any edge cache, including one filled by `osty airgap import`. Without `osty-edge`, freezes and fresh verdicts only arrive through new imports.

### Does osty-proxy need the control plane to block a pull?

No. Every decision comes from the local edge cache and the pinned policy, so holds, blocks and freezes already in the cache keep working while the control plane is unreachable.

### Can a developer bypass FAIL_CLOSED with a header?

No. The `X-Osty-Origin` header can only switch a `dev-laptop` instance to `prod-ci`, never the other way.

### Are osty-edge and osty-proxy open source?

They are source-available. The `osty` CLI source, the policy schema and `osty-sensor` are Apache 2.0.

## Related pages

- [Kubernetes](https://osty.dev/integrations/kubernetes): Install both daemons with the `osty-edge` Helm chart.
- [Artifactory, Nexus and GitHub Packages](https://osty.dev/integrations/artifactory): Put `osty-proxy` in front of an existing registry.
- [Policy reference](https://osty.dev/docs/policy): `proxyFailureMode`, `blockVerdicts` and every `killSwitch` key.
- [Architecture](https://osty.dev/architecture): Plane 1 (`osty-brain`), the control plane (`osty-control`, PostgreSQL 17, Temporal) and the thin edge (`osty-edge`, `osty-proxy`, `osty-sensor`), plus the accepted ADRs behind them.

## See your fleet in 10 minutes

Connect a read-only GitHub App and cloud role. Osty installs nothing in your environment and writes nothing to your repositories, and the report shows false positives, stale deploys and unowned workloads.

Get a free X-Ray: https://osty.dev/xray

Written by Osty Engineering. Published 2026-11-29. Updated 2026-11-29.

Canonical: https://osty.dev/docs/edge-proxy
