All components follow the same pattern: DefaultConfig() → LoadConfig(path) → Validate(). Configs are YAML; the agent and CLI also honour environment
variables.
server:
http_port: 8080 # REST API port
grpc_port: 9090 # gRPC (agent) port
database:
driver: sqlite # SQLite only (PostgreSQL is not yet supported)
path: kbridge.db
auth:
jwt_secret: "..." # REQUIRED; use a long random value in production
token_pepper: "" # HMAC key for agent tokens at rest; empty = reuse jwt_secret
access_token_expiry: 1h
refresh_token_expiry: 168h
admin_email: admin@kbridge.local # seeded on first start if set
admin_password: changeme
admin_name: Admin
audit:
retention_days: 90 # logs older than this are pruned
cleanup_interval: 24h # how often the prune job runs
bootstrap: # optional dev convenience; omit in production
agent_token: "dev-token"
agent_cluster: "dev-cluster"
rbac:
policy_file: "configs/rbac.yaml" # empty disables enforcement (allow-all)
tls:
enabled: false
cert_file: "certs/tls.crt"
key_file: "certs/tls.key"
streams:
max_concurrent: 50 # max simultaneous streaming sessions (logs -f / get -w)| Key | Required | Notes |
|---|---|---|
auth.jwt_secret |
yes | Signing key for access tokens |
auth.token_pepper |
no | HMAC key for agent tokens at rest; when empty, falls back to jwt_secret. Set a dedicated value for key separation. Changing it invalidates existing agent tokens (re-issue them) |
database.path |
yes | SQLite file path |
bootstrap.* |
no | Seeds one agent token at startup; prefer the admin API |
rbac.policy_file |
no | When empty, all authenticated users are allowed |
tls.* |
no | When enabled, cert_file + key_file are required |
streams.max_concurrent |
no | Cap on concurrent streaming sessions; 0/unset → default 50 |
central:
url: localhost:9090 # central gRPC address
token: dev-token # agent token (bound to one cluster)
tls:
enabled: false
ca_file: "certs/tls.crt" # CA to verify central; empty = system roots
insecure: false # skip verification (dev only)
cluster:
name: dev-cluster # unique cluster identifier (must match the token)| Variable | Overrides | Default |
|---|---|---|
KBRIDGE_CONFIG |
config file path | configs/agent.yaml |
KBRIDGE_CENTRAL_URL |
central.url |
localhost:9090 |
KBRIDGE_AGENT_TOKEN / AGENT_TOKEN |
central.token |
— |
KBRIDGE_CLUSTER_NAME |
cluster.name |
default |
central_url: https://central.example.com:8080
current_cluster: production-us-east
token: "" # set by `kb login`
refresh_token: ""
insecure_skip_verify: false # skip TLS verification for self-signed dev certsServer-authenticated TLS protects the HTTP API, the agent↔central gRPC channel, and the CLI.
-
Generate a dev certificate (localhost + 127.0.0.1):
make certs # writes certs/tls.crt and certs/tls.key -
Enable on central (
tls.enabled: true, point at the cert/key). -
On the agent, set
central.tls.enabled: trueand eitherca_file: certs/tls.crt(verify) orinsecure: true(skip — dev only). -
For the CLI, use an
https://central_url; with a self-signed cert setinsecure_skip_verify: true.
The same certificate secures both the HTTP and gRPC servers.