Scopes control how services access other services' databases and APIs. Every cross-service connection requires a scope grant before the builder will wire it up.
| Access type | Grant system | What's shared | Declared in |
|---|---|---|---|
| Database access | Koko scope grants | Connection strings (MongoDB, Redis, Neo4j) | spec.scopes (owner) + CLI request (consumer) |
| API access | Bio-ID scope grants | Authenticated service-to-service API calls | spec.dependencies (consumer) |
No unauthenticated cross-service connections. Every dependency goes through an approval gate.
Services can share database access through Koko's scope system. The owner declares what it shares, a consumer requests access, and an org admin approves.
spec:
scopes:
- resource: mongodb
database: shared-data
allowedConsumers:
- service: my-consumer
access: readOnly
Only services listed in allowedConsumers can request access.
tawa scopes request --from owner-service --resource mongodb --access readOnly
The builder injects a connection string as an environment variable in the consumer service.
| Level | Description |
|---|---|
readWrite | Full CRUD on MongoDB, all Redis commands, full Neo4j access |
readOnly | MongoDB read preference enforced, Redis GET only, Neo4j read-only transactions |
The owner service name is uppercased with hyphens replaced by underscores:
SHARED_DATA_SVC_MONGODB_URI=mongodb://host:27017/shared-data
Your service's own MONGODB_URI is unaffected — scoped variables always include the owner service name as a prefix.
For service-to-service API calls, use spec.dependencies with Bio-ID scopes:
spec:
dependencies:
- service: raterspot
transport: direct # injects RATERSPOT_URL
scopes: [raterspot:rate] # REQUIRED, cannot be empty
See the catalog-info.yaml reference for full details on the dependencies vs internalDependencies distinction.
| Transport | Injects URL env var | Routes through Janus |
|---|---|---|
direct | Yes — {SERVICE}_URL | No |
gateway | No | Yes — routes via api.tawa.insureco.io |
Use direct when you need the URL for direct K8s DNS calls. Use gateway when you need Janus to mediate the request (e.g., for additional gas metering or auth enforcement).
# Request database access from another service
tawa scopes request --from owner-service --resource mongodb --access readOnly
# List pending and approved scope requests
tawa scopes list
# Approve an incoming scope request (org admin)
tawa scopes approve <request-id>
# Deny an incoming scope request
tawa scopes deny <request-id>
# Revoke previously granted access
tawa scopes revoke <request-id>
# owner-service catalog-info.yaml
spec:
scopes:
- resource: mongodb
database: analytics
allowedConsumers:
- service: reporting-service
access: readOnly
# owner-service catalog-info.yaml
spec:
scopes:
- resource: redis
allowedConsumers:
- service: worker-service
access: readWrite
Last updated: February 28, 2026