Overview
Secure[str] lets you pass secrets (passwords, API keys, tokens) to your workflow without exposing them in the sandbox. The real values are held by the orchestrator and injected only at the moment they’re used.
Defining Secure Params
Create a Pydantic model where every field usesSecure[str]:
Using Secure Params
AddSecureParams as the second parameter to your run() function:
workflow.py
workflow.py
How It Works
API validates
The API receives the real secret value and validates it as the inner type (e.g.,
str with min_length=8).Sandbox gets references
The sandbox receives
SecureValue("field_name") reference objects — never the actual secret.Sending Secrets via API
Requests that includesecure_workflow_params must be HMAC-signed. Sending secure_workflow_params with only the x-api-key header returns:
Signing scheme
Every signed request sends three headers:| Header | Value |
|---|---|
x-api-key | Your API key. Still required (API Gateway uses it to look up the signing key.) |
x-timestamp | Current time. Accepts Unix seconds, Unix milliseconds, or ISO 8601. Tolerance is ±5 minutes. |
x-signature | hmac_sha256(signing_key, canonical_request) as a lowercase hex digest. |
\n:
POST /runs, that’s literally POST\n/runs\n<timestamp>\n<body_hash>.
Python example
SecureValue
SecureValue is the reference object that represents a secret inside the sandbox. You never construct these directly — they are injected by the sandbox harness when the workflow starts.
Properties
| Property | Type | Description |
|---|---|---|
identifier | str | Field name from SecureParams |
Supported Operations
SecureValue objects can only be passed to computer.type():
Key Guarantees
| Property | Description |
|---|---|
| Never in the sandbox | Real values exist only in the orchestrator’s memory |
| Validated before use | Field constraints are enforced on the real value at the API layer |
| Type-safe | Secure[str] is a proper Python type — your editor will flag misuse |
| Audit-safe | Secret values never appear in logs, error traces, or sandbox output |
Adding Secrets via Dashboard
- Navigate to your deployment or workflow
- Click Secrets in the sidebar
- Click Add Secret
- Enter the name and value
- Click Save
Scope Levels
| Scope | Description | Use Case |
|---|---|---|
| Deployment | Available to all workflows on a deployment | Shared credentials |
| Workflow | Available only to a specific workflow | Workflow-specific keys |
| Organization | Available across all deployments | Global API keys |
Security
Encryption
- At rest: AES-256 encryption
- In transit: TLS 1.2+
- Key management: AWS KMS or equivalent
Access Control
- Secrets are scoped to deployments/workflows
- API key required for access
- Audit logging for all secret operations
Automatic Redaction
Secret values are automatically redacted from:- Workflow logs
- Error messages
- API responses
- Video recordings