Skip to content

Commit efebd94

Browse files
author
Marco Napetti
committed
feat(vz): enable delivered secret-shim mediation
1 parent 18b9fba commit efebd94

5 files changed

Lines changed: 33 additions & 5 deletions

File tree

crates/firma-run/src/backend/macos_vz.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -335,9 +335,9 @@ impl SandboxBackend for VzBackend {
335335
reason: SecretShimUnsupportedReason::HostCallable,
336336
}
337337
}
338-
VzStructuralMode::VzGuest => SecretShimSupport::Unsupported {
339-
reason: SecretShimUnsupportedReason::HostCallable,
340-
},
338+
VzStructuralMode::VzGuest => {
339+
isolated_guest_shim_support(ShimTarget::linux_musl(), None)
340+
}
341341
}
342342
}
343343

docs-site/public/llms.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,3 +63,4 @@ OpenFirma docs highlights for LLM-based retrieval:
6363
- Composio Cedar context includes `composio_toolkit`, `composio_tool_slug`, `composio_user_id`, `composio_account`, `composio_session_id`, `composio_batch_index`, and `composio_batch_size`. Signed audit events identify each tool through its canonical action class and `composio://<toolkit>/<tool_slug>` resource without changing the shared protobuf contract or recording credentials, raw arguments, request selectors, or provider response bodies.
6464
- The secret gateway (`fsp_…` placeholder tokens) is a distinct mechanism from static credential injection: the Sidecar rehydrates outbound placeholders and masks inbound secret echoes via `firma-run`'s broker over `FIRMA_SECRET_GATEWAY_ADDR` (`unix://` or `tcp://` endpoint), and can also intercept configured HTTP vault responses (`[[sidecar.http_secret_providers]]`) to extract, placeholder-ize, and push newly seen secrets. All three paths are fail-closed: rehydration denies the whole request if any placeholder can't be resolved (never forwards a partially-substituted body), a `blocked_command` HTTP vault path is rejected before the connector is ever contacted (not dispatched then discarded), and a failed push to the broker aborts the response (`CREDENTIAL_INJECTION_FAILED`) rather than hand the agent an unresolvable placeholder. Invalid HTTP-provider matchers and HTTP providers configured without a gateway reject Sidecar startup.
6565
- `firma run` `secret_providers` in `firma.toml` automates the gateway for its per-run Sidecar: `[run.defaults]` / `[run.profiles.<id>] secret_providers` entries are either a bare string naming a built-in CLI integration (e.g. `"bws"`, `"op"`) or a full table `{ type = "cli", binary_name, provider_id, credential_env_vars, matchers = [{type="sensitive_command"|"safe_command"|"blocked_command", argv, matcher, stripped_options, append_options}] }` or `{ type = "http", provider_id, host, matchers = [{type="sensitive_command"|"safe_command"|"blocked_command", path, matcher}] }`. CLI entries activate an in-sandbox shim via the `firma-run` broker; HTTP entries are mirrored into the synthesized `[sidecar].http_secret_providers`. Merge: defaults + active profile, later wins on `binary_name` (CLI) / `provider_id` (HTTP); unknown bare name fails closed; presence is authorization.
66+
- The repository-owned `curl | sh` installer keeps `firma-secret-shim` out of `PATH`. Tarball installs use `libexec/openfirma/secret-shims/<linux-musl-target>/` relative to the installed `firma`; the macOS Homebrew branch checksum-fetches and preinstalls its version-qualified resource under `$(brew --prefix)/var/openfirma/secret-shims/<version>/<linux-musl-target>/` before invoking Brew, outside versioned kegs. Linux uses the shim from its primary release archive. A custom VZ guest bundle records the exact required shim digest in `manifest.txt`. A direct `brew install Firma-AI/openfirma/firma` remains CLI-only until the external tap packages that private resource. Explicit installs of published releases through `v0.1.6` are also CLI-only because those archives predate private shim packaging; a missing shim in a current or newer release aborts before changing the installation.

docs-site/src/content/docs/guides/secret-gateway.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,32 @@ not supported — define them as a full `{ type = "http", ... }` table.
7272
under opaque `fsp_…` placeholders the gateway resolves later. An entry being
7373
present is itself the authorization to intercept — no separate policy check
7474
gates it.
75+
76+
CLI secret mediation is available on backends that declare shim support:
77+
the Linux bwrap backend (host bind-mount) and the macOS VZ guest backend
78+
(isolated guest with VSOCK broker bridge). WSL2 and sandbox-exec
79+
compatibility mode are unsupported because the wrapped process can call the
80+
host directly, so a shim would be redundant. Firecracker support is planned
81+
but not yet implemented.
82+
83+
Install with the repository-owned `curl | sh` installer to receive the
84+
target-qualified private shim used by these backends. On macOS, that
85+
installer completes both its tarball and Homebrew branches by downloading
86+
and checksum-verifying the matching Linux-musl shim archive. Running
87+
`brew install Firma-AI/openfirma/firma` directly currently installs the CLI
88+
only because the external tap does not yet package this private resource;
89+
VZ CLI-provider mediation then fails closed during preflight. The shim is
90+
intentionally not exposed on `PATH`.
91+
A custom VZ guest bundle records the exact shim digest in `manifest.txt`;
92+
install that matching shim rather than mixing artifacts from another build.
93+
Published releases through `v0.1.6` predate this private artifact. When one
94+
of those versions is explicitly selected with `--version`, the installer
95+
reports that it is installing the historical CLI only; missing shims in
96+
current or newer release archives abort before the installation is changed.
97+
Tarball installs keep the shim under
98+
`libexec/openfirma/secret-shims/<linux-musl-target>/` beside `firma`.
99+
The Homebrew branch preinstalls it outside versioned kegs under
100+
`$(brew --prefix)/var/openfirma/secret-shims/<version>/<linux-musl-target>/`.
75101
- **HTTP entry** — mirrored into the autostarted Sidecar's
76102
`[sidecar].http_secret_providers` so the Sidecar's MITM path can intercept
77103
matching vault responses. Fail-closed: an unknown vault path is `blocked`, a

docs-site/src/content/docs/quickstart.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { Steps, Tabs, TabItem } from '@astrojs/starlight/components';
77

88
This quickstart takes you from nothing installed to a real agent running under enforcement: its outbound calls are checked against policy, allowed or denied, and written to the audit log.
99

10-
The default install path uses a single precompiled static binary. You do not need a build toolchain, or any API keys, unless you choose to build from source.
10+
The default install path uses precompiled static binaries. You do not need a build toolchain, or any API keys, unless you choose to build from source.
1111

1212
## Install
1313

@@ -42,7 +42,7 @@ OpenFirma can be installed with a one-line script or built from source. The scri
4242

4343
</Steps>
4444

45-
The installer drops the binary in `~/.local/bin` by default and adds it to your shell's `PATH`.
45+
The tarball installer drops `firma` in `~/.local/bin` by default and adds that directory to your shell's `PATH`. It keeps backend support binaries in a private `libexec/openfirma` directory beside `firma`. The Homebrew path stores its private guest shim under `$(brew --prefix)/var/openfirma/secret-shims/<version>/<target>/` instead. These support binaries are not commands and must not be added to `PATH`.
4646

4747
</TabItem>
4848
<TabItem label="From source">

examples/firma-run/macos-vz-basic-exec/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,5 +90,6 @@ generated by the artifact builder:
9090
vmlinuz
9191
initrd.img
9292
rootfs.img
93+
firma-secret-shim
9394
manifest.txt
9495
```

0 commit comments

Comments
 (0)