Skip to main content
FTL’s credential linter scans all agent-generated code changes for hardcoded secrets and dangerous operations before merge. The linter runs automatically as part of the diff review process.

How It Works

Before you review changes, FTL computes a diff of all modified files and scans added lines for:
  1. Hardcoded shadow credentials — the ftl_shadow_* values injected into the sandbox
  2. Known credential patterns — API keys, access tokens, and other secrets
  3. Dangerous SQL operations — destructive database commands
  4. Dangerous shell commands — destructive filesystem operations
The linter only scans added lines (lines starting with + in the diff) and skips non-code files like .lock, .json, .yaml, .yml, .toml, .cfg, and .ini.

Detected Patterns

Shadow Credentials

FTL generates shadow credential values using the pattern ftl_shadow_<name>_<hex>. The linter flags any code that hardcodes these values:
It also detects exact matches of the shadow values themselves, even if they don’t follow the naming pattern.
If the agent hardcodes a shadow credential, it means the code is not reading from environment variables correctly. This will break when the code runs outside the sandbox with real credentials.

Known Credential Patterns

The linter detects common API key and token formats: All patterns require the value to be quoted (single or double quotes) to reduce false positives.

Dangerous SQL Operations

The linter flags destructive SQL commands:
  • DROP TABLE
  • DROP DATABASE
  • DROP SCHEMA
  • TRUNCATE TABLE
  • TRUNCATE (without TABLE)
  • DELETE FROM without WHERE clause
These are advisory warnings, not hard blocks. The linter reminds you to verify the operation is intentional.

Dangerous Shell Commands

The linter flags destructive shell operations: Like SQL warnings, these are advisory — the linter displays them separately from credential violations.

Lint Output

When violations are detected, FTL displays them before the diff review:
Violations are advisory only — you can still approve the merge. However, you should carefully review the flagged code to ensure:
  1. Credentials are loaded from environment variables, not hardcoded
  2. Destructive operations are intentional and safe
Credential violations indicate the code will not work correctly outside the sandbox. Fix the code to read from os.environ or process.env before merging.

Bedrock Guardrails Alternative

For hard-blocking enforcement instead of advisory warnings, configure Bedrock Guardrails. When a guardrail is active, it replaces the local linter and blocks merge if credentials or PII are detected.

Implementation Details

The linter is implemented in ftl/lint.py using regex patterns. It scans the unified diff format output from the container’s internal diff computation. Key functions:
  • lint_diffs(diffs, shadow_env) — scans added lines and returns violations
  • display_violations(violations) — pretty-prints violations to the terminal
The linter runs automatically during ftl code and before the interactive merge command in the FTL shell. You cannot disable it — it’s a core safety layer.