Skip to main content

Overview

FTL uses environment variables for two distinct purposes:
  1. FTL infrastructure credentials - API keys for FTL itself (Anthropic, AWS, Langfuse)
  2. Project credentials - Secrets your agent needs, loaded from .env and shadowed

FTL Infrastructure Credentials

These credentials are stored in ~/.ftl/credentials and loaded automatically on every FTL invocation. You don’t need to export them in each session.

Setting Credentials

Use ftl auth to save credentials persistently:

Credentials File Format

The file ~/.ftl/credentials uses a simple KEY=VALUE format:
~/.ftl/credentials
  • Lines starting with # are comments
  • Each line is KEY=VALUE (no quotes needed)
  • File permissions are set to 0600 (owner read/write only)
  • Values are loaded into os.environ at startup

Required Variables by Feature

string
Required for:
  • Agent: "claude-code"
  • Agent: "aider" (if using Anthropic models)
  • Tester: "claude-*" models
Get your key at console.anthropic.com
string
Required for:
  • Agent: "codex"
  • Agent: "aider" (if using OpenAI models)
  • Tester: "openai/*" models
string
Required for:
  • Snapshot backend: "s3"
  • Secrets Manager integration
  • Bedrock Guardrails
  • CloudWatch tracing
  • Tester: "bedrock/*" models
string
AWS secret access key. Required for all AWS integrations.
string
AWS region for S3, Secrets Manager, CloudWatch, and Bedrock.Default: us-east-1

Optional Tracing Variables

string
Langfuse public key for LLM observability. Requires pip install -e ".[tracing]".
string
Langfuse secret key. Required when using Langfuse tracing.
string
Langfuse API host.Default: https://cloud.langfuse.com

Project Credentials (Shadow System)

How Shadow Credentials Work

FTL generates fake “shadow” values for your real credentials and injects only the shadows into the sandbox. The agent never sees your real keys. Your .env file:
.env
Injected into sandbox:
The agent writes code using these shadow values. FTL’s lint scanner checks the diff for leaked shadows before merge.

Shadow Value Format

Shadow values follow a recognizable pattern:
Generation: ftl/credentials.py:64-67

Loading Project Credentials

FTL loads project credentials from two sources:
  1. .env file in project root - Every KEY=VALUE pair is treated as sensitive
  2. shadow_env config - Additional var names from .ftlconfig pulled from host os.environ
.ftlconfig
Loading logic: ftl/credentials.py:70-91

Credential Swap Table

For the optional network proxy feature, FTL builds a swap table mapping shadow values to real values:
At the network layer, the HTTP/HTTPS proxy replaces shadow bytes with real values before requests reach upstream servers. Swap table generation: ftl/credentials.py:94-111

Forwarding Non-Sensitive Variables

Use agent_env in .ftlconfig to forward environment variables without shadowing:
.ftlconfig
These values are passed directly to the sandbox from your host os.environ.

AWS Secrets Manager Integration

When secrets_manager_prefix is set in .ftlconfig, FTL fetches secrets from AWS Secrets Manager instead of reading .env.
.ftlconfig

Secret Value Formats

JSON object secrets are expanded:
Plain string secrets use the last path segment as the key name (uppercased):
Shadow values are generated from these secrets identically to .env loading.

Security Notes

  • Your real .env file never enters the container
  • Shadow credentials are session-specific (regenerated on each run)
  • The ~/.ftl/credentials file is set to mode 0600 (owner-only access)
  • FTL’s lint scanner checks for leaked shadow values before merge

Source Reference

  • Credentials loading: ftl/credentials.py:10-35
  • Shadow generation: ftl/credentials.py:64-111
  • Save credential: ftl/credentials.py:38-61
  • File location: ftl/credentials.py:7