Repository navigation
Releases
Releases · sotarak/anchor
Anchor v0.5.3
A security release. No change to encryption, stored data or the API: a 0.5.2 CLI keeps working
against a 0.5.3 server and the reverse. Read the upgrade notes: a few clients now refuse what they
used to accept.
Security
anchor runno longer injects secrets with reserved names, the ones that change how a
program loads code or where it connects (PATH,NODE_OPTIONS,LD_*/DYLD_*,PYTHONPATH,
JAVA_TOOL_OPTIONS,GIT_SSH*,*_PROXY,ANCHOR_*and similar, matched case-insensitively).
It warns with their names and runs without them;--allow-reservedopts back in. The same
rule applies toanchor export --format dotenvand toloadAnchorEnvin
@anchor-secrets/nestjs(allowReservedKeys: true). The SDK exportsisReservedEnvKey.anchor export --format dotenvnever writes a line a shell would run or expand. A value
that cannot be quoted safely fails with the existing hint to use JSON or YAML.- Login is limited per address and email instead of per account: 5 failures for one email
from one address (an IPv6 /64 counts as one) or 50 from one address lock that pair or address
for 15 minutes. Nobody can lock the owner out from elsewhere any more, and the429no longer
tells which emails have accounts. A password reset clears the locks on its email. - CLI browser login asks for the code.
/cli/loginignores?code=and the person types the
code from their terminal;anchor loginopens/cli/loginand prints
Open <url> and enter the code XXXX-XXXX. - The SDK refuses plain
http://except to localhost, 127.0.0.1 and [::1], as the CLI already
did;allowInsecureHttp: trueoverrides it. - The CLI and the SDK never follow HTTP redirects, which would resend the bearer token to
another address. A redirect is an error that names the origin. anchor runremovesANCHOR_TOKENfrom the command's environment unless--pass-token.- Security headers on every Worker response (
nosniff,no-referrer,DENYframing, a
default-src 'none'CSP and HSTS) and HSTS on the dashboard. - Release workflows pin every action to a commit SHA, and the npm publish job installs
dependencies without running their scripts.
Changed
anchor runandanchor exporttake--allow-reserved;anchor runtakes--pass-token.loadAnchorEnvreturns{ loaded, skipped }and acceptsallowReservedKeys.ClientOptionsin@anchor-secrets/sdkacceptsallowInsecureHttp.- Docs: the security model lists the accepted risks (approving a code someone sent you, open MCP
client registration, folder writers and child processes, plain http by opt-in).
Upgrade notes
- Reserved names: a folder that stores
NODE_OPTIONS,*_PROXY,PATH,ANCHOR_*and the
like now gets a warning and those variables are not set. Add--allow-reserved(CLI) or
allowReservedKeys: true(NestJS) where you really mean it. - Dotenv export: a value with a
'or a newline together with$, a backtick,"or\, or a trailing\now
fails;
export JSON or YAML instead. ANCHOR_TOKENunderanchor run: a command that itself callsanchoror the SDK with the
parent's token needs--pass-token.- SDK over http: a service that reaches Anchor at
http://on a host other than localhost
needsallowInsecureHttp: true(or, better, https). - Redirects: an API URL that redirects (an old hostname, an auth proxy) now fails with a clear
error; use the final address. - CLI login: older CLIs still open
/cli/login?code=…; the page shows the empty code form and
the code is in their terminal. - Database: migration
0009_login_attemptsadds one table; the normal upgrade applies it.
Anchor v0.5.2
Added
anchor imports list | add | removemanages folder imports from the CLI. The source is
written<env>:<path>(shared:/,prod:/shared); the folder is--envand--path.
addis idempotent, andremoveasks for confirmation (non-TTY needs--yes). Not to be
confused withanchor secrets import, which loads a file.--jsonprints the import DTOs.
Changed
- Copy value in each secret row's ⋮ menu copies the stored value, like the copy button in the
value cell. A sensitive value is read on click (audited like a reveal) and only reaches the
clipboard. - Secret rows stay one line. The Comment column truncates earlier and Version and Updated no
longer wrap, so a long comment no longer doubles a row's height. - Skills:
anchor-migrateadds the/sharedimport itself withanchor imports addinstead
of sending you to the dashboard, andanchor-clilists the import commands. - Docs: imports are a live link; References and imports now says when changes show up
(the next read; a runninganchor runneeds a restart or--watch; an export is a snapshot).
Fixed
- The project overview shows subfolders. It listed only keys stored directly at the path, so
a project whose secrets all live in folders looked empty ("No secrets at this path"). Subfolders
now come first, with a mark per environment, and open on click.GET /overviewaddsfolders.
The first column reads "Name", search covers keys and folders, and each folder starts on page 1. imports listnumbers imports 1, 2, 3 in the order they apply (--jsonkeepsposition).- A 404 during
anchor loginno longer hints at runninganchor login --api-urlagain; it
asks for the address of your Anchor dashboard. - An empty List in the secret sheet says "Add at least one item" instead of "must be a JSON
array of strings". - The CLI login approval page always names the account it signs in as.
- Deploy docs: Troubleshooting covers
could not be found [code: 7404], a copy that still
names a deleted database, and the deploy guide warns that upgrading never needs a new database.
Anchor v0.5.1
Fixed
anchor login --api-urlmakes the URL your default server. Before, login saved the URL
only when no default existed, so moving a deployment to a custom domain left every later
command on the old host. An explicit--api-urlthat differs from the saved default now
replaces it and printsDefault server changed from <old> to <new>.ANCHOR_API_URLand the
prompt still only fill an empty default, and.anchor.jsonnever writes it.login --json
addsdefaultApiUrl. Sessions for the old server stay stored untilanchor logout --api-url.- A 404 that does not come from Anchor names the server. It reads
<origin> did not answer as an Anchor server (HTTP 404), with a hint to check the URL or run
anchor login --api-url, instead ofUnexpected response from server (HTTP 404). Browser
login no longer reports such a server as one without browser login.
Changed
- CLI login approval page. It names the account the terminal signs in as, shows the code in
its own tile, lists Device, IP address and Requested on one baseline, keeps the warning to one
compact line and gives Deny and Approve equal width. The OAuth consent page uses the same
key-value list. - Secret editors per type. The type picker shows a name and a line of help (Text, Number,
Boolean, JSON, List, PEM). Number asks for a decimal keypad, Boolean is a true/false choice,
JSON has a Format button and names the line and column of a syntax error, List edits one row
per item (stored as a JSON array of strings), and PEM loads a file in the browser and names the
detected block. Type problems show once you leave the field or save. A stored list or JSON
value revealed and saved without edits is sent back byte for byte. - Editing a secret starts with a "Value unchanged" row (Reveal current value, Replace value,
and Keep current value to go back), for every type. - Sensitive is a switch, still on by default.
Anchor v0.5.0
Added
- Conditional reads of a folder.
GET /secretssends anETag(a keyed HMAC of the exact
response body, so a tag never reveals a value) and answers a matchingIf-None-Matchwith
304 Not Modified: no body, no audit row, with or withoutreveal. The SDK, the NestJS module
andanchor run --watchrefresh this way, so an unchanged folder no longer writes one
secret.readrow per refresh. - SDK conditional refresh.
@anchor-secrets/sdkstores the tag with each cached folder
(CacheEntry.etag) and sends it back on refresh, also withfresh: true; a304keeps the
cached values without decoding them again.cache: falsenever sendsIf-None-Match. Folders
cached by 0.4.0 refresh with a plain request first. anchor run --watchrestarts the command when its secrets change. It checks every
--watch-intervalseconds (default 30, minimum 5) withIf-None-Match, restarts with
SIGTERMthenSIGKILLafter 10 seconds, keeps the command running while Anchor is
unreachable, and exits with the command's code when it stops on its own.
Fixed
- OAuth: approving an app again revokes your earlier grants for it, so only the newest approval
stays live (oauth.authorizedrecordsrevokedGrants). - OAuth: the consent page keeps
stateand the other parameters byte for byte. Values such as
true,null,1e3or12345678901234567890were rewritten by the router's JSON parsing and
broke the client's state check. - SDK: folder values are frozen all the way down, so nested
jsonandlistvalues cannot be
changed by one reader under another;loadSecretsstill returns fresh copies. - SDK: an abort from inside
onEventstops a retry wait at once. - SDK: a folder opened from a warm shared cache refreshes
ttlMsafter that entry was fetched,
not after it was opened, and never replaces its values with an older entry. - SDK: with a slow cache store, a read that arrives during a fetch joins it, and a stale store
answer never starts a second fetch. - Release: an npm publish that fails because the version is already out (published by hand, or
slow to show) now succeeds after checking the registry, so a re-run finishes. Declarations in
package subfolders are emitted with their.d.ctstwins.
Security
- OAuth: the cap of 10 pending client registrations counts an IPv6 client by its
/64prefix,
so one host can no longer register without limit by rotating addresses. IPv4 (including
IPv4-mapped IPv6) counts the full address.oauth_clients.ipstores this normalized key.
Anchor v0.4.0
Added
- Value types. Every secret version has a type:
string(the default),json,pem,
number,booleanorlist(a JSON array of strings). The server checks a value against its
type on write and answers400 value is not valid for type <type>: <reason>. - Sensitive flag. A secret is sensitive (the default) or plain config. Non-sensitive values are
shown in the dashboard table, byanchor secrets listand byanchor secrets getwithout a
reveal. - CLI:
anchor secrets set --type <type>and--sensitive/--no-sensitive, checked locally
before sending;secrets listhas a TYPE column (and a VALUE column for non-sensitive rows). anchor export --format json|yamlwrites typed values (numbers, booleans, arrays, JSON);
dotenvandanchor runkeep the stored text.- Dashboard: a Type select and a Sensitive checkbox in the secret sheet, a type tag in the secrets
table, and plain values for non-sensitive rows. - Browser login for the CLI.
anchor loginprints a short code, opens
/cli/login?code=XXXX-XXXXin the browser, and waits until you approve or deny it in the
dashboard (device-authorization flow; the request expires after 10 minutes).--no-browser
only prints the URL. anchor secrets importloads a dotenv, JSON or YAML file into one environment and folder:
nested keys are flattened into UPPER_SNAKE (configs.openrouter.api_key→
CONFIGS_OPENROUTER_API_KEY), types are inferred, existing keys are skipped unless
--overwrite,--non-sensitive <glob>marks plain config, and--dry-runshows the plan. The
whole file is validated before anything is written, values are never printed, and an
interrupted import resumes when run again.- Service tokens without an expiry.
anchor tokens create --expires-in never(and No
expiry in the dashboard) creates a token that stays valid until it is revoked, for machines
nobody rotates. The CLI warns, and token lists shownever. - MCP server for AI agents.
POST /mcpserves Claude Code, Codex and other MCP clients over
Streamable HTTP with eight tools:list_projects,list_environments,list_folders,
list_secrets,get_secret,secret_history,set_secretanddelete_secret. Agents sign in
with OAuth 2.1 (authorization code with PKCE, dynamic client registration, RFC 8414/9728
metadata, token revocation): the dashboard shows an approval page, and Account → Connected
apps lists and revokes approved agents. Permissions aresecrets:read,secrets:writeand
the opt-insecrets:revealfor sensitive values. - Node SDK and NestJS module.
@anchor-secrets/sdkreads folders of secrets in any Node 20+
service: typed values decoded, an in-memory cache (one minute by default) with background
refresh, retries with jittered backoff, and the last good values kept when Anchor is
unreachable; no runtime dependencies.@anchor-secrets/nestjsaddsAnchorModule.forRoot/
forRootAsync,AnchorServiceandloadAnchorEnvfor NestJS 10 to 12. Both ship ESM and
CommonJS and are published with the CLI. - Agent skills.
npx skills add sotarak/anchor --skill anchor-cli --skill anchor-migrate --skill anchor-ciinstalls skills that teach coding agents to run apps withanchor run, keep
secret values out of their context, migrate config files and set up CI tokens.
Changed
- References (
${...}) expand only instringvalues; typed values are always used as stored. - Listing secrets without
revealreturns the values of non-sensitive secrets; sensitive ones stay
masked. Such a list is still not recorded as a secret read, since it holds only plain config. anchor loginuses the browser by default. Email and password login moves behind
--with-password, which--emailand--password-stdinstill imply. Password logins are now
audited withmethod: "password".
Security
- The value type and the sensitive flag are bound into the AES-GCM additional data (AAD v2), so a
database writer cannot flip a secret to non-sensitive or change its type without decryption
failing. Versions written before 0.4.0 keep their original AAD and read as sensitive strings. - Only a dashboard (web) session can approve or deny a CLI login; CLI sessions and service tokens
get403. Approvals and denials are audited (auth.cli_login_approved,
auth.cli_login_denied), and the token endpoint is polled with a single-use, rate-limited
device code. - OAuth codes and tokens for MCP clients are random 256-bit values stored only as SHA-256 hashes.
Access tokens last 1 hour, refresh tokens 30 days and rotate on every use; presenting a used
refresh token or authorization code revokes the whole grant. Only a dashboard session can
approve an agent,/mcpaccepts only OAuth access tokens, and those tokens work nowhere else. - Reading sensitive values over MCP needs
secrets:reveal, granted only when the person ticks it
on the approval page; every reveal and every write is audited withvia: "mcp"and the client
id. Approving, denying and revoking agents are audited (oauth.authorized,oauth.denied,
oauth.revoked). - A token created with
--expires-in neveris a standing credential: nothing retires it if it
leaks. Its creation is audited withexpiresAt: null; scope it narrowly and revoke it when the
machine goes away.
Upgrade notes
- Migrations
0005_typed_values,0006_cli_logins,0007_service_token_no_expiryand
0008_oauthare applied bypnpm deployand by Workers Builds (button deploys). Manual deploys
runpnpm exec wrangler d1 migrations apply DB --remotefrom the repository root before
deploying. No data is rewritten: existing secrets read as sensitivestringvalues, and existing
service tokens keep their expiry. run_worker_firstgrows. The Worker must answer the OAuth and MCP paths before static
assets:/mcp,/.well-known/oauth-authorization-server,
/.well-known/oauth-protected-resource(and/*below it),/oauth/token,/oauth/register
and/oauth/revoke, next to/api/*. The repository'swrangler.jsonchas the new list; a
deploy that keeps its ownwrangler.jsoncmust copy it, or MCP clients get the dashboard's HTML.- Rate limiting. If you put a WAF rate-limiting rule in front of the login endpoints, extend it
to/oauth/*(see Rate limiting). - CLI 0.3.x keeps working against a 0.4.0 server, but cannot set types or log in through the
browser. - CLI 0.4.0 against a 0.3.x server cannot use browser login; it says so and points at
anchor login --with-password. Upgrade the server first. - Rolling back below 0.4.0 is not supported once 0.4.0 has written a secret. Versions written
by 0.4.0 are sealed with AAD v2, which 0.3.x cannot open: revealing them,anchor runon a folder
that holds one, and updating them fail with a 500 until you upgrade again. No data is lost. Take
the D1 Time Travel bookmark before upgrading if you may need to go back.
Anchor v0.3.0
Added
- Deploy to Cloudflare button. One click copies the repository to your GitHub or GitLab
account, creates the D1 database and the queues, asks for the root key, applies the migrations
and deploys. Every push to the copy redeploys through Workers Builds. - README screenshots of the dashboard and a recording of the CLI, regenerated from a seeded local
instance withpnpm --filter @anchor/web media. - Docs: deploying with the button, upgrading a button deploy (merge the release tag from upstream),
upgrading and uninstalling the CLI for every install method, and troubleshooting for install and
deploy failures.
Changed
- First-owner setup needs no setup token. The first account created at
/setupowns the
instance; later attempts get409and never touch the existing owner. Create the owner right
after deploying.ANCHOR_SETUP_TOKENis no longer read, thesetup_disabled(503) and
invalid-token (403) responses are gone, and a request that still sendssetupTokenis accepted. - The Worker config moved to the repository root:
wrangler.jsoncand.dev.vars.examplenow live
there, and everywranglercommand runs from the root. New root scripts:
pnpm db:migrate:local, andpnpm deploy:workernow applies the D1 migrations before deploying. - Dashboard polish:
- the header shows the project and environment as a breadcrumb;
- the secrets table has its own Comment column and one-line rows;
- overlays, menus, sheets and table rows fade and slide in gently, and stay still when the
system asks for reduced motion; - the version history sheet is wider, so its dates and authors no longer wrap or clip.
Fixed
- Every clickable control in the dashboard shows a pointer cursor; disabled ones show
not-allowed. - Table footers count one item in the singular ("1 token", not "1 tokens").
- The audit log names its targets (secret key, token name, email) instead of showing internal IDs.
- The CLI no longer warns "No OS keychain available" when
ANCHOR_CREDENTIAL_STORE=fileis set on
purpose. A real fallback from the keychain still warns.
Upgrade notes
- Manual deploys: move your
database_idfromapps/server/wrangler.jsoncinto the root
wrangler.jsonc(theDBentry), and moveapps/server/.dev.varsto.dev.varsat the
repository root. Runwranglercommands from the root from now on. The database name and
binding are unchanged, so no data moves. See
Upgrade an instance. - Setup token: nothing to do for an instance that already has an owner. Delete the unused
ANCHOR_SETUP_TOKENsecret withwrangler secret delete ANCHOR_SETUP_TOKEN. - CLI: no breaking changes; update to 0.3.0 with the tool you installed it with.
Anchor v0.2.0
Added
- CLI distribution.
- The CLI is published to npm as
@anchor-secrets/cli(npm install -g @anchor-secrets/cli),
with provenance. - Homebrew tap:
brew install sotarak/tap/anchor. - Install script for macOS and Linux that verifies the download against
SHA256SUMS:
curl -fsSL https://sotarak.github.io/anchor/install.sh | sh. - GitHub Action for CI:
uses: sotarak/anchor/setup-action@v<version>. - npm, Homebrew and the install script also install the CLI as
anchor-secrets, for machines
where anotheranchoris onPATH.
- The CLI is published to npm as
Changed
- Tag releases are published right away instead of as drafts, and also publish to npm and
Homebrew. Release tags arev<version>only;cli-v<version>tags no longer start a release.
Anchor v0.1.0
The first public release of Anchor: a self-hosted secrets manager that runs entirely on
Cloudflare Workers, D1 and Queues.
Added
- Core API and encryption.
- First-owner setup guarded by a setup token; password login with lockout.
- Projects with environments.
- Encrypted, versioned secret storage: AES-256-GCM per value under a per-project key (KEK),
wrapped by a root key held as a Worker secret.
- Access control and audit.
- Instance roles, and project memberships with environment restrictions.
- Scoped, expiring, revocable service tokens.
- Single-use invite links, password reset links and session management.
- An append-only audit log of reads and changes, never values, with 365-day retention and a
query API.
- CLI (
anchor).login/logout/whoami, with OS keychain or0600file credential storage.initwith a.anchor.jsonproject file.secrets list|get|set|delete, with values never accepted in argv.run -- <cmd>, which injects env and forwards signals, andexportto dotenv/JSON/YAML.- Service token commands.
--jsonon every command, and stable exit codes.- Release binaries for macOS, Linux and Windows.
- Dashboard.
- Setup, login, invite and password-reset pages.
- A projects overview matrix, the environment secrets view with masked values, and environment
settings. - Members, service tokens with one-time reveal, users and invites, the audit log viewer, and an
account page. - Served by the Worker with a strict CSP.
- Advanced secrets.
- Folders, with guarded and forced deletion.
- Version history, audited past-version reveal, and rollback.
- Secret references (
${KEY},${env:/path/KEY}) with authorization on every hop and with
cycle, depth and size limits. - Folder imports.
- Background project-key rotation through Cloudflare Queues, and root-key rotation by re-wrapping.
- Project.
- Licensed under the Apache License 2.0; contributions under the Developer Certificate of
Origin, checked in CI. - A documentation site at https://sotarak.github.io/anchor/ (guides, operations runbooks,
security model, API reference).
- Licensed under the Apache License 2.0; contributions under the Developer Certificate of