Overview

A store is a project-scoped key-value store whose values Prism encrypts at rest. Keys are free-form paths such as prod/database-url, and each write adds a new version of the key. One version is the current one, which is what readers get unless they ask for a specific version, so you can stage a new value, switch to it, and switch back if it turns out to be wrong.

Access is granted per store, and a grant can be limited to a key prefix (--key-prefix prod/). A service account that may read prod/ sees neither the values nor the names of keys outside it.

Prerequisites

  1. Create a store

    prism stores create -p payments --name app-config -d "Payments service configuration"
  2. Write values

    Values are read from --file or stdin and stored as raw bytes, so certificates and binary files work as well as strings. --make-current makes the new version the one readers get.

    echo -n 'postgres://payments:…@db.internal/payments' \
      | prism stores values put prod/database-url -p payments --store app-config --make-current
    
    prism stores values put prod/stripe-key -p payments --store app-config \
      --file stripe-key.txt --make-current
    
    prism stores values put staging/database-url -p payments --store app-config \
      --file staging-db.txt --make-current
    
    prism stores values list -p payments --store app-config
    # retrieval_key         current_version  latest_version
    # prod/database-url     1                1
    # prod/stripe-key       1                1
    # staging/database-url  1                1
  3. Let the application read its keys

    Grant the built-in prism:store-reader role (stores.get and stores.list), limited to the prod/ prefix:

    prism stores add-grant -p payments --store app-config \
      --principal payments-api --effect allow \
      --role prism:store-reader --key-prefix prod/

    Use prism:store-writer for a principal that should also write and delete values, or a custom role for anything in between.

  4. Read values from the application

    With the CLI, authenticated as the service account:

    prism --profile app auth sa-login-with-apikey --api-key "$PRISM_API_KEY"
    
    prism --profile app stores values get prod/database-url -p payments --store app-config
    prism --profile app stores values get prod/stripe-key -p payments --store app-config \
      --out /run/secrets/stripe-key
    
    # Keys outside the granted prefix are denied, and not listed
    prism --profile app stores values get staging/database-url -p payments --store app-config
    # Error: HTTP 403: … policy denied action StoresGetValue for principal payments-api@…

    Or over HTTP with the service account's token, which returns the raw bytes (URL-encode the / in the key as %2F):

    curl -fsS -H "Authorization: Bearer $TOKEN" \
      https://prism.example.com/api/v1/payments/stores/app-config/values/prod%2Fdatabase-url

    The token can come from any service account login: an API key or key pair, GitHub Actions, or an EC2 instance profile, so the application needs no secret of its own to fetch its secrets.

  5. Rotate and roll back

    Write the new value without --make-current to stage it, switch to it when ready, and switch back to the previous version if needed:

    prism stores values put prod/stripe-key -p payments --store app-config --file new-key.txt
    prism stores values metadata prod/stripe-key -p payments --store app-config
    # current_version: 1
    # latest_version: 2
    
    prism stores values set-current prod/stripe-key -p payments --store app-config --version 2
    
    # Roll back
    prism stores values set-current prod/stripe-key -p payments --store app-config --version 1
    
    # Read an old version explicitly, or remove it for good
    prism stores values get prod/stripe-key -p payments --store app-config --version 1
    prism stores values delete-version prod/stripe-key -p payments --store app-config --version 1

Patterns

GoalHow
One store per environmentSeparate stores (prod-config, staging-config) with separate grants
One store, many servicesPrefix keys by service (ledger/…, api/…) and grant each service account its prefix
Operators rotate, apps only readprism:store-writer for an operators group, prism:store-reader for the service accounts
Temporary access during an incidentAdd --expires-at "2026-11-12 08:00:00" to the grant

Auditing

Every request is audit logged with the principal, the key in the request path and the result, including denied reads:

prism org audit --org acme --limit 50

Security considerations