Skip to content

TOML Schema

envpkt.toml is validated against a JSON Schema. The schema is published at:

  • npm: envpkt/schema (importable via package exports)
  • GitHub: schemas/envpkt.schema.json

Enable editor autocompletion by adding the schema directive on line 1:

#:schema https://raw.githubusercontent.com/jordanburke/envpkt/main/schemas/envpkt.schema.json
FieldTypeRequiredDescription
versionnumberYesSchema version number (currently 1)
catalogstringNoPath to shared secret catalog (relative to config file)

Identity and capabilities.

FieldTypeRequiredDescription
namestringYes (if section present)Agent display name
consumer"agent" | "service" | "developer" | "ci"NoConsumer type classification
descriptionstringNoAgent description or role
capabilitiesstring[]NoCapabilities this agent provides
expiresstring (date)NoAgent credential expiration (YYYY-MM-DD)
servicesstring[]NoService dependencies
key_filestringNoPath to age identity (private key) file
recipientstringNoAgent’s age public key for encryption
secretsstring[]NoSecret keys this agent needs from catalog

Per-secret metadata. Each key corresponds to an environment variable name.

FieldTypeRequiredTierDescription
servicestringNoScan-firstService this secret authenticates to
expiresstring (date)NoScan-firstExpiration date (YYYY-MM-DD)
rotation_urlstring (URI)NoScan-firstURL for rotation procedure
purposestringNoContextWhy this secret exists
commentstringNoContextFree-form annotation or note
capabilitiesstring[]NoContextOperations this secret grants
createdstring (date)NoContextProvisioning date (YYYY-MM-DD)
rotatesstringNoOperationalRotation schedule (e.g., 90d, quarterly)
rate_limitstringNoOperationalRate limit info (e.g., 1000/min)
model_hintstringNoOperationalSuggested model or tier
sourcestringNoOperationalSecret origin (e.g., vault, ci, manual)
encrypted_valuestringNoValueAge-encrypted ciphertext — mutually exclusive with from_key
from_keystringNoAliasReference another secret entry (format: "secret.<KEY>") — see Aliases
requiredbooleanNoEnforcementWhether secret is required for operation
tagsobjectNoEnforcementKey-value tags for grouping/filtering

Plaintext environment defaults. Each key corresponds to an environment variable. These are non-secret values that are safe to commit — use [secret.*] for sensitive credentials.

FieldTypeRequiredDescription
valuestringYes unless aliasedDefault value for this env variable — mutually exclusive with from_key
from_keystringNoReference another env entry (format: "env.<KEY>") — see Aliases
purposestringNoWhy this env var exists
commentstringNoFree-form annotation or note
tagsobjectNoKey-value tags for grouping/filtering
[env.NODE_ENV]
value = "production"
purpose = "Runtime environment mode"
comment = "Override to 'development' for local testing"
[env.LOG_LEVEL]
value = "info"
purpose = "Application log verbosity"

Some consumers expect a credential under a different env var name than the one you use canonically. from_key exposes the same governed value under multiple canonical names without duplicating it.

[secret.API_KEY]
service = "example"
expires = "2026-12-31"
rotation_url = "https://api.example.com/settings/keys"
purpose = "Authenticates envpkt-managed tooling"
# Same governed value, exposed under a second name for a consumer
# that hardcodes a different env var name.
[secret.LEGACY_API_KEY]
from_key = "secret.API_KEY"
purpose = "Name required by the legacy consumer"

Works identically for [env.*]:

[env.SERVICE_URL]
value = "https://api.example.com"
[env.LEGACY_URL]
from_key = "env.SERVICE_URL"

Rules:

  • from_key must be formatted as "secret.<KEY>" or "env.<KEY>".
  • The target must exist in the same resolved config (after catalog merge).
  • The target must not itself be an alias — single hop only.
  • An alias cannot also declare a value-producing field (encrypted_value for secrets, value for env entries). It has no value of its own.
  • Cross-type aliasing (secret → env or env → secret) is rejected at load time.

Runtime behavior:

At boot, envpkt injects both the target AND every alias pointing at it, as separate entries in process.env holding the same value:

$ envpkt exec -- env | grep API_KEY
API_KEY=sk-...
LEGACY_API_KEY=sk-...

Audit, envpkt inspect, envpkt env export, and MCP responses all list aliases as first-class entries, tagged with alias_of so the relationship is visible. Status (expiration, health) is inherited from the target — an alias is healthy iff its target is healthy.

envpkt audit --all includes env default drift alongside secret health. Use envpkt audit --env-only to see only env defaults.

Policy configuration for credential lifecycle management.

FieldTypeDefaultDescription
stale_warning_daysnumber90Days since creation to consider a secret stale
require_expirationbooleanfalseRequire expires on all secrets
require_servicebooleanfalseRequire service on all secrets

Automation callbacks for lifecycle events.

FieldTypeDescription
on_expiringstringCommand or webhook when secrets are expiring
on_expiredstringCommand or webhook when secrets have expired
on_audit_failstringCommand or webhook on audit failure

Tool integration configuration. Open namespace for third-party extensions.

[tools]
fnox = true
mcp = true