spotlight_harness_profile

The spotlight_harness_profile resource, and the API's harness-profile kind: a team's set of permission rules, MCP servers, native harness settings and workspace secrets for its runs. A station names one in its profile.

KindEndpointTerraformAddress
harness-profile/api/v1/resources/teams/{teamId}/harness-profilesspotlight_harness_profile<team key>/<key>

See Resource API for the operations, headers and errors every kind shares.

Example

resource "spotlight_harness_profile" "core_careful" {
  team_id = spotlight_team.core.id
  key     = "careful"

  permissions = {
    allow = ["read", "edit", "execute(npm test *)"]
    ask   = ["execute(git push *)"]
    deny  = ["read(.env)"]
  }

  mcp_servers = [
    {
      name    = "acme"
      command = "npx"
      args    = ["-y", "acme-mcp"]
      env     = { ACME_API_KEY = "secret.ACME_API_KEY" }
    },
  ]

  native = {
    claude-code = { includeCoAuthoredBy = false }
    codex       = "model_verbosity = \"low\"\n"
  }

  secrets = [spotlight_secret.staging_viewer.name]
}

Fields

FieldTypeDefaultDescription
keystringrequiredWhat stations name the profile by, as in careful. Lowercase words joined by dashes, at most 64 characters. Immutable: an update that changes it is rejected; Terraform replaces the resource.
permissions.allowarray of strings[]Rules for what the agent may do.
permissions.askarray of strings[]Rules for what the agent asks a person about first.
permissions.denyarray of strings[]Rules for what the agent may never do.
mcpServersarray of objects[]Stdio MCP servers, started in the sandbox. A remote server is named on an integration instead; see MCP servers.
nativeobject{}Each harness's own settings, by harness id. See native settings.
secretsarray of strings[]Names of workspace secrets that the runs of this profile get. See Secrets.
envmap of strings{}Environment variables that the runs of this profile get, each set to the value of a workspace secret. See Environment variables.

permissions accepts no other keys.

Permission rules

A rule is a kind, alone or with a pattern in parentheses.

KindCovers
readreading and searching files
editediting, deleting and moving files
executerunning commands
RuleMeaning
executeevery command
execute(npm test *)commands matching the pattern
read(.env)reading the paths matching the pattern
  • A pattern may not be empty.
  • A rule may appear once, under one of allow, ask and deny.
  • For each kind, a bare rule sets what happens to anything no patterned rule matches. A kind has at most one bare rule.
  • A kind with no bare rule is allowed.
  • A rule with a pattern is an exception to the kind's bare rule.

An ask rule becomes a Spotlight approval. A permission request is put to a person only when its kind has an ask rule, bare or patterned; a request of any other kind, such as a web fetch, is allowed. See Approvals.

MCP servers

FieldTypeDefaultDescription
namestringrequiredLowercase words joined by dashes, at most 64 characters. Each name once per profile.
commandstringrequiredThe command that starts the server, as in npx.
argsarray of strings[]Its arguments.
envmap of name to string{}Its environment. Names match ^[A-Za-z_][A-Za-z0-9_]*$.

An env value is plain text, stored and shown as written, or a reference to a workspace secret written secret.<NAME>, as in secret.ACME_API_KEY.

  • A reference must name a secret the workspace has, or the write fails with 422.
  • The server receives a stand-in, and egress injects the value in place of it, in the server's requests to the host the secret is bound to.
  • A secret a profile references cannot be deleted.

Every harness gets the servers when its session starts. Cursor also gets them in cursor/mcp.json.

Secrets

secrets names workspace secrets that the agent of each run can use in its own requests, as in ["STAGING_VIEWER"].

  • Each name must be a secret the workspace has, or the write fails with 422 and Secret <NAME> not found. Please create it first.
  • Each name may appear once.
  • A secret a profile names cannot be deleted.
  • The agent never gets the value. The run's briefing tells it where to send the stand-in spotlight-egress:<NAME> for each binding of the secret, as in authorization: Bearer spotlight-egress:STAGING_VIEWER. Egress puts the value in place of the stand-in, in requests to the bound host.
  • A run of the profile goes only to a runner with an egress.

See Give agents a secret for an API.

Environment variables

env maps an environment variable to the name of a workspace secret, as in { GITHUB_APP_PRIVATE_KEY = "DEV_GITHUB_APP_KEY" }. The run gets the real value of the secret in the variable.

  • A secret the workspace does not have fails the write with 422 and uses secret <NAME> that the workspace does not have.
  • A secret with sandbox = "stand-in" fails the write with 422 and names secret <NAME>, which does not allow its value in a sandbox. Set sandbox = "env" on the secret.
  • A variable name uses letters, digits and _, and does not start with a digit.
  • PATH, HOME, USER, LOGNAME, SHELL, TERM, COLORTERM, names that start with SPOTLIGHT_, HTTP_PROXY, HTTPS_PROXY, NO_PROXY, ALL_PROXY, NODE_USE_ENV_PROXY, SSL_CERT_FILE, SSL_CERT_DIR, NODE_EXTRA_CA_CERTS, REQUESTS_CA_BUNDLE, CURL_CA_BUNDLE and GIT_SSL_CAINFO are rejected, in any case, because the runner sets them.
  • A variable that a harness sets itself, such as ANTHROPIC_API_KEY, is rejected with 422 and sets <VARIABLE>, which a harness sets itself: <harnesses>.
  • TRACEPARENT is rejected with 422 and sets TRACEPARENT, which the harness command sets on every run.
  • A secret that env names cannot be deleted.
  • The runner gets the values when the run starts, before the repository setup commands. The setup commands, the harness and the agent's spotlight commands have the variables. Editor terminals and the setup commands of a warm sandbox do not.
  • The runner puts spotlight-egress:<NAME> in place of each value in the run's journal, transcript and messages to Spotlight.
  • A run on a host or on a push pool can get the variables. They need no egress.
  • A run whose runner cannot get a value fails with The runner couldn't prepare the run. Error: Secret <NAME> could not be put in the sandbox: <reason>, and the code unprepared. See Run phases.
  • A replay gets no variables.

See Give a run a secret as an environment variable.

Native settings

KeyValueRead by the harness as
claude-codean objectClaude Code settings JSON
codexa string of TOMLCodex config.toml
cursoran objectCursor CLI config JSON
opencodean objectOpenCode config JSON (opencode.json)

A key that names no harness, a claude-code, cursor or opencode value that is not an object, and a codex value that does not parse as TOML are rejected with 422.

How each harness receives it

A run's harness, other than OpenCode, gets the profile's settings as files in the run's state directory, .spotlight/state within the run's working copy. See Inside a sandbox. Spotlight does not remove a repository's own settings files, such as .claude/settings.json or AGENTS.md.

OpenCode gets no files. Its settings go into the JSON of the OPENCODE_CONFIG_CONTENT environment variable, with the model. See Harness environment.

HarnessFilesDirectory variableAlso
claude-codeclaude/settings.jsonCLAUDE_CONFIG_DIRask and deny rules go into the session as managed settings, with bypass-permissions mode disabled.
codexcodex/config.toml, codex/rules/spotlight.rulesCODEX_HOMEThe harness runs in codex-acp's read-only mode, with a workspace-write sandbox on every turn.
cursorcursor/cli-config.json, cursor/mcp.jsonCURSOR_CONFIG_DIR
HarnessWhat the files contain
claude-codepermissions.allow and permissions.defaultMode from the rules, then native.claude-code layered over them. defaultMode is acceptEdits unless edit is not allowed. Each MCP server is allowed as mcp__<name>.
codexconfig.toml is native.codex as written. spotlight.rules contains a prefix_rule for each execute rule with a pattern.
cursorcli-config.json contains permissions.allow and permissions.deny from the rules, then native.cursor layered over them. mcp.json contains the MCP servers.
opencodeOPENCODE_CONFIG_CONTENT contains permission from the rules, then native.opencode layered over it. See OpenCode permissions.

OpenCode permissions

Each kind of rule is written to OpenCode tools:

KindOpenCode keys
readpermission.read, and permission.glob and permission.grep
editpermission.edit
executepermission.bash

permission.read, permission.edit and permission.bash are each an object of pattern to decision: "*" first, with the kind's bare rule, then one entry for each rule with a pattern. OpenCode applies the last pattern that matches. permission.glob and permission.grep get only the bare read decision, because they match search patterns, not paths. An ask decision becomes an ACP permission request, which Spotlight puts to a person as for the other harnesses.

OpenCode gets the MCP servers when its session starts.

Warnings

Where a harness cannot apply a rule as written, the profile's warnings name the approximation. The write succeeds.

A secret the profile names, in secrets, in env or in an MCP server's env, that awaits a value also gets a warning: names secret <NAME>, which has no value. Runs with this profile do not start until a person sets it See Value.

Harness warnings include:

HarnessCaseEffect
claude-codeA looser patterned rule under a bare deny, or under a bare ask for readThe bare rule applies to the whole kind.
claude-code, cursor, opencodenative sets a key the rules also writeThe native value replaces it.
codexAny read rule other than allowDoes not apply; Codex reads what its sandbox can see.
codexA bare edit rule other than allow, or any edit rule with a patternDoes not apply; edits are decided by the sandbox.
codexA bare execute rule other than allowDoes not apply; only patterned execute rules apply.
codexAn execute pattern with a wildcard other than a final * wordWritten as every command starting with the words before the wildcard.
codexAn execute pattern starting with a wildcardLeft out.
codexnative.codex sets approval_policy, approvals_reviewer or sandbox_modeReplaced on every turn.
cursorA bare ask for readRead is allowed.
cursorA patterned rule under a bare denyThe kind is denied.
cursorAn ask rule under an allowed kindDenied instead.
cursorAn execute pattern of more than one wordWritten for the command's first word only.
cursorAny MCP serverMay not load: Cursor asks a person to approve each server, and ACP carries no such request.
opencodeA read rule with a pattern whose decision differs from the bare read ruleDoes not apply to glob and grep searches, which follow the bare rule.

Delete

A delete fails with 409 in-use while any station names the profile.

A station that names a profile its team does not have is not rejected when the line is written; its runs fail with the code refused.

See Limit what agents may do, Give an MCP server a secret and Give agents a secret for an API.

On this page