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.
| Kind | Endpoint | Terraform | Address |
|---|---|---|---|
harness-profile | /api/v1/resources/teams/{teamId}/harness-profiles | spotlight_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
| Field | Type | Default | Description |
|---|---|---|---|
key | string | required | What 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.allow | array of strings | [] | Rules for what the agent may do. |
permissions.ask | array of strings | [] | Rules for what the agent asks a person about first. |
permissions.deny | array of strings | [] | Rules for what the agent may never do. |
mcpServers | array of objects | [] | Stdio MCP servers, started in the sandbox. A remote server is named on an integration instead; see MCP servers. |
native | object | {} | Each harness's own settings, by harness id. See native settings. |
secrets | array of strings | [] | Names of workspace secrets that the runs of this profile get. See Secrets. |
env | map 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.
| Kind | Covers |
|---|---|
read | reading and searching files |
edit | editing, deleting and moving files |
execute | running commands |
| Rule | Meaning |
|---|---|
execute | every 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,askanddeny. - 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
| Field | Type | Default | Description |
|---|---|---|---|
name | string | required | Lowercase words joined by dashes, at most 64 characters. Each name once per profile. |
command | string | required | The command that starts the server, as in npx. |
args | array of strings | [] | Its arguments. |
env | map 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
422andSecret <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 inauthorization: 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
422anduses secret <NAME> that the workspace does not have. - A secret with
sandbox = "stand-in"fails the write with422andnames 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 withSPOTLIGHT_,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_BUNDLEandGIT_SSL_CAINFOare rejected, in any case, because the runner sets them.- A variable that a harness sets itself, such as
ANTHROPIC_API_KEY, is rejected with422andsets <VARIABLE>, which a harness sets itself: <harnesses>. TRACEPARENTis rejected with422andsets TRACEPARENT, which the harness command sets on every run.- A secret that
envnames 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
spotlightcommands 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 codeunprepared. See Run phases. - A replay gets no variables.
See Give a run a secret as an environment variable.
Native settings
| Key | Value | Read by the harness as |
|---|---|---|
claude-code | an object | Claude Code settings JSON |
codex | a string of TOML | Codex config.toml |
cursor | an object | Cursor CLI config JSON |
opencode | an object | OpenCode 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.
| Harness | Files | Directory variable | Also |
|---|---|---|---|
claude-code | claude/settings.json | CLAUDE_CONFIG_DIR | ask and deny rules go into the session as managed settings, with bypass-permissions mode disabled. |
codex | codex/config.toml, codex/rules/spotlight.rules | CODEX_HOME | The harness runs in codex-acp's read-only mode, with a workspace-write sandbox on every turn. |
cursor | cursor/cli-config.json, cursor/mcp.json | CURSOR_CONFIG_DIR |
| Harness | What the files contain |
|---|---|
claude-code | permissions.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>. |
codex | config.toml is native.codex as written. spotlight.rules contains a prefix_rule for each execute rule with a pattern. |
cursor | cli-config.json contains permissions.allow and permissions.deny from the rules, then native.cursor layered over them. mcp.json contains the MCP servers. |
opencode | OPENCODE_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:
| Kind | OpenCode keys |
|---|---|
read | permission.read, and permission.glob and permission.grep |
edit | permission.edit |
execute | permission.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:
| Harness | Case | Effect |
|---|---|---|
claude-code | A looser patterned rule under a bare deny, or under a bare ask for read | The bare rule applies to the whole kind. |
claude-code, cursor, opencode | native sets a key the rules also write | The native value replaces it. |
codex | Any read rule other than allow | Does not apply; Codex reads what its sandbox can see. |
codex | A bare edit rule other than allow, or any edit rule with a pattern | Does not apply; edits are decided by the sandbox. |
codex | A bare execute rule other than allow | Does not apply; only patterned execute rules apply. |
codex | An execute pattern with a wildcard other than a final * word | Written as every command starting with the words before the wildcard. |
codex | An execute pattern starting with a wildcard | Left out. |
codex | native.codex sets approval_policy, approvals_reviewer or sandbox_mode | Replaced on every turn. |
cursor | A bare ask for read | Read is allowed. |
cursor | A patterned rule under a bare deny | The kind is denied. |
cursor | An ask rule under an allowed kind | Denied instead. |
cursor | An execute pattern of more than one word | Written for the command's first word only. |
cursor | Any MCP server | May not load: Cursor asks a person to approve each server, and ACP carries no such request. |
opencode | A read rule with a pattern whose decision differs from the bare read rule | Does 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.