Skip to content

Secrets & protected files

How hlix discovers, encrypts and restores project credentials, and keeps them out of Git history and logs.

Protected project files travel to the cloud through a separate, encrypted path. hlix restores them for authorized work and excludes their paths from its commits.

Recognized protected files include:

  • .env and environment-specific dotenv files, except examples/templates
  • .envrc, with literal assignments collected without executing shell code
  • credential and service-account JSON
  • .npmrc and .pypirc
  • private-key and certificate-key formats such as .pem, .key, .p12, and .pfx
  • terraform.tfvars and terraform.tfvars.json
  • regular text files containing a high-confidence private-key or provider-token pattern
  • protected skill and MCP configuration

The dry-run report lists paths and key names, never values:

Terminal window
hlix import . --dry-run --json

When no override is provided, hlix composes development dotenv files in this order:

  1. .env
  2. .env.development
  3. .env.local
  4. .env.development.local

Later assignments win. Use an explicit file when the inferred development environment is not the one intended for cloud:

Terminal window
hlix import . --dry-run --env-file .env.cloud-development
hlix import . --env-file .env.cloud-development

The selected dotenv files supply the active project secrets. Check activeEnvFiles, secretKeys and envCollisions in the dry-run output.

Literal .envrc assignments join the selected development secret set. Dynamic shell expressions are not executed during scanning. If your active shell already holds the resolved value — for example after direnv loaded it from a secret manager such as 1Password or Doppler — hlix collects that value. Otherwise import stops so you can activate the environment and try again.

A protected file crosses three zones: your machine records only metadata and sends the file separately, hlix verifies every hash and encrypts the file at rest, and the Cloud Machine checks the bytes again, writes them readable only by their owner, and keeps them out of every commit.

Source and protected configuration follow separate paths. Your machine identifies protected files; Hlix authenticates their transfer and encrypts stored values; authorized jobs receive supported secrets separately from source code.Your machine1 · scan source, history, and protected paths2 · keep protected bytes separate from ordinary sourcehlix3 · authenticate the upload to your Workspace4 · encrypted at rest under your Workspace's own data key5 · provision configuration for an authorized jobCloud Machine6 · load supported secrets into the job’s environment7 · exclude protected paths from source commits
Trace a protected file
The scan identifies protected paths. Their bytes travel separately from ordinary source.
  1. The local scanner reads protected bytes into memory and records only path, kind, size, hash, and key names in the manifest.
  2. Protected files are omitted from the Git snapshot and sent separately over the authenticated TLS API request.
  3. hlix checks that every supplied path, kind, size and SHA-256 exactly matches the manifest.
  4. Values and file contents are encrypted at rest with AES-256-GCM under a key unique to your Workspace, so encrypted data copied into another Workspace cannot be decrypted there.
  5. For an authorized task, hlix decrypts the protected files and writes them into the task’s Cloud Machine as files — never as command arguments.
  6. The Cloud Machine validates the bytes again, refuses path traversal and symlink targets, writes the files with owner-only permissions (0600), and excludes their paths from Git.
  7. Every commit removes protected paths once more before it is made, as a final guard.

The same integrity checks apply in reverse during hlix pull.

Encryption at rest is not end-to-end encryption. hlix decrypts values for authorized project work and for an authenticated hlix pull. Inside the project’s Cloud Machine, a task, its harness and the repository’s setup commands can read the values written there.

Use project-scoped credentials for the environment you are importing.

Skill files and raw MCP configuration are preserved as encrypted protected resources. Project instruction files such as AGENTS.md and CLAUDE.md import as ordinary project files unless they contain detected secrets.

Project import can also create saved MCP connections from recognized configuration, preserving supported enabled/disabled settings. Review the reported imported, disabled and action_required results. Use hlix skill import, hlix agent import or hlix mcp import for explicit resource imports; their activation rules are separate from automatic connection import.

For the explicit hlix mcp import resource command, credentials must use project-secret references:

  • Use ${KEY} for a remote header, or an authentication scheme followed by the placeholder, such as Authorization: Bearer ${TOKEN}.
  • A sensitive stdio argument must be exactly one complete ${KEY} placeholder.

The placeholder is resolved from the project’s encrypted secrets at task time, so the value lives in one place and the configuration stays safe to read, diff and share. Import skills, agents & MCP covers the full activation path, including the checks for remote and stdio transports.

If protected data cannot be decrypted or required secrets cannot be resolved, dispatch stops rather than starting with an empty or partial environment. A connected secret manager’s outage can use its last successfully fetched encrypted values for up to 24 hours; without a usable copy, work cannot start. See Secrets for outage and rotation behavior.

A run’s record redacts known secret values and protected-file contents. Keep credentials out of application output.

Excluding a current .env file does not erase an older committed value. Import scans up to 10,000 commits for sensitive paths and high-confidence patterns and blocks by default when it finds them.

If a credential entered Git history:

  1. Rotate or revoke it first.
  2. Decide whether history must be rewritten.
  3. Verify the rewritten repository independently.
  4. Re-run hlix import . --dry-run.

--history preserve is the default: findings in the history are reported (count in the plan and --json) and the history is uploaded with the files; protected files never enter the source upload. --history sanitize uploads the current files without earlier commits and leaves your local Git history unchanged. It does not revoke an exposed credential.

Protected files synchronize separately from source commits. Edit them locally, then push the updated project files:

Terminal window
hlix push

Pulling the synchronized project files restores protected bytes with owner-only permissions:

Terminal window
hlix pull

If both local and cloud protected state changed, review the conflict and choose push or pull.

  • A task fails immediately with an empty credential. The key name was imported but its value was not. Add the value at its declared source and push the updated files; MCP and environment configuration carry key names only.
  • hlix import blocks on a missing key. A key the project declares is fatal; one it only references in source is a warning. Provide the declared value, or remove the declaration.
  • The wrong dotenv profile was activated. Re-import or push with --env-file <path>; every other profile was preserved encrypted, so nothing was lost.
  • A .envrc key is empty. Dynamic assignments are never executed. Let direnv resolve it into your shell, then scan again.
  • A protected-file sync conflict. Review both versions and choose push or pull.
  • A job still receives an old credential after rotation. Update the project’s stored secret, or confirm its connected manager is reachable and returning the new value. A rotated file needs a new hlix push; an unreachable manager can temporarily serve its saved values.
  • You find a secret value in a dry-run report. Stop sharing the report, rotate the exposed value and contact support privately. Reports should contain metadata and key names, not secret values.
  • MCP remote headers must use ${KEY} placeholders; literal credentials are refused. The header carried a real token. Move the value into the project’s secrets and reference it by name.
  • MCP remote header <name> must be a strict environment placeholder template — the header referenced a key but wrapped it in extra text. It must be exactly ${KEY}, or one approved scheme followed by it.
  • MCP stdio arguments must not contain literal credentials or MCP stdio secret arguments must use a complete environment placeholder. A command-line argument held a token, or a partial placeholder. A sensitive argument must be exactly one complete ${KEY}.
  • A preserved resource has no effect. A protected skill needs explicit resource import. For an MCP connection, check its import result, enabled state and authorization in the dashboard.