Configuration reference
glassops.yaml is optional. Without it, the commands use their defaults and the default pipelines. The schema is schemas/config.json. It rejects keys it does not know, so a typo is an error. glassops doctor validates the file.
Secrets are never written in the file. A secret field names an environment variable with a $VAR value, and the value stays in your CI's secret store.
Beyond the schema, these rules are checked:
- Org Ids look like Salesforce org Ids, unless written as a
$VAR. - No two targets share an org Id.
- At most one target has tier
prod. - Every policy window names a time zone that exists, and its
fromandtodiffer. - Every blackout has valid dates and ends on or after its start date.
policy.permit_ttlis a duration from 5 minutes to 24 hours.- A separation of duties approval sets
environmentorlabel, and alabelneedsapprovers. - Every
environments.<name>.devhubnames a configured target. - No pipeline step is empty.
- With provider
exec,exec.pathslists at least one path. - With
policy.permit.signing: sigstore, bothidentityandissuerare set, andrepository(when set) isowner/name. - Every
telemetry.otlp.headersvalue is a whole$VARreference. - An operation's
paramsneed itsrunwritten as a list. Every{name}placeholder in the list is declared underparams, every param is used, and each param has at least one limit. Apatterncompiles as RE2, and adefaultpasses its own limits. See Operation params. - Every
tools.sf.pluginsentry is an npm package name with one exact version, such as2.0.1. A range is refused. - The file stays inside the YAML limits: an alias that refers to itself is refused, and so are files nested deeper than 64 levels or expanding past 100000 values.
Names (targets, tiers, environments, pipelines) are lowercase letters, digits, _ and -, starting with a letter.
Top-level keys
| Key | Required | What it holds |
|---|---|---|
version |
yes | The schema version. Always 1 |
provider |
no | salesforce or exec. Detected from the project files when absent, except exec, which is never detected |
targets |
no | Orgs that changes go to, with their login |
policy |
no | Deploy windows, blackouts and the rules gate evaluates |
operations |
no | Named production commands that are not a deploy, run under an operations PERMIT. See operations |
salesforce |
no | Salesforce provider settings |
environments |
no | Ephemeral environments that env create makes |
test |
no | Test levels and coverage minimums for test |
check |
no | Project scripts that check runs |
analyze |
no | Code Analyzer settings |
verify |
no | Settings for verify. See Verify, coverage and YAML settings |
exec |
no | The commands provider exec runs. See The exec provider |
telemetry |
no | Opt-in export of run spans to an OpenTelemetry collector. See Pull request comment and OpenTelemetry export |
report |
no | Settings for report. See Pull request comment and OpenTelemetry export |
pipelines |
no | Named lists of steps for run |
tools |
no | sf plugins at exact versions that glassops setup installs. See tools |
version and provider
targets
One entry per org. The key is the target name that --target takes.
| Field | Meaning |
|---|---|
id |
What the login must land on (the guard), or a $VAR holding it. For Salesforce it is an org Id, 15 or 18 characters. For provider exec it is a plain Id that your exec.describe prints: letters, digits and . _ : / -, starting with a letter or digit, compared exactly |
tier |
A name that policy windows, rules and test levels key on. prod, devhub and ephemeral have fixed meaning in the guard |
kind |
Optional. production, sandbox or scratch, the kind of org this target must be. The guard refuses a login to an org of another kind, and gate --no-connect records it in the PERMIT as a declared kind. prod and devhub already need production and ephemeral already needs scratch, so on those tiers kind may only repeat that. Use it on a tier of your own, such as a drill target on a scratch org |
branch |
The git branch that deploys to this target. plan --from auto uses its merge base when the target has no deployed tag |
auth |
The login. See Authentication |
logins |
Extra named logins to the same org, a map of name to an auth block. auth stays the default login. A name is a lower case letter, then lower case letters, digits, _ or -. See below |
plan.scope |
full or delta, for plan --target with this target. It wins over salesforce.delta.enabled. See plan scope |
A name under environments can also have an entry here, to set its tier or plan.scope. Its org Id and login still come from env create.
targets:
ephemeral:
plan: { scope: full }
devhub:
id: $SF_DEVHUB_ORG_ID
tier: devhub
auth: { method: jwt, username: $SF_USERNAME, client_id: $SF_CLIENT_ID, key: $SF_JWT_KEY }
prod:
id: $SF_PROD_ORG_ID
tier: prod
branch: main
auth: { method: jwt, username: $SF_PROD_USERNAME, client_id: $SF_CLIENT_ID, key: $SF_JWT_KEY }
Named logins. Two targets cannot share an org Id, so a project that signs in to one org as several users, such as a deploy user, a site build user and an integration user, defines the extra users under logins on that one target. An exec step picks one with login. Each login takes the same fields as auth, and $VAR references are resolved when it logs in. Every login runs the guard against the target's own org Id, so a login that reaches another org is refused. glassops doctor --auth checks each one. The choice of login is part of glassops.yaml, so a PERMIT, which binds the config hash, binds it too.
targets:
prod:
id: $SF_PROD_ORG_ID
tier: prod
auth: { method: jwt, username: $SF_DEPLOY_USER, client_id: $SF_CLIENT_ID, key: $SF_JWT_KEY }
logins:
site-build:
{ method: jwt, username: $SF_SITE_USER, client_id: $SF_CLIENT_ID, key: $SF_SITE_KEY }
integration: { method: sfdx-url, url: $SF_INTEGRATION_URL }
A login is defined only under targets. A name that is only under environments has no logins, because its login comes from env create.
policy
What gate evaluates. The rules are described in PERMIT and rules.
| Field | Meaning |
|---|---|
windows |
Per tier, a list of allowed deploy windows: days, from, to (24 hour HH:MM) and tz (an IANA zone) |
blackouts |
Date ranges (from, to, optional tiers and reason) when no deploy is allowed |
rules |
coverage_min, analyzer_max_severity, separation_of_duties, destructive_needs_label, validate_passed (default { tiers: [prod] }, { tiers: [] } to switch it off) |
permit_ttl |
How long a PERMIT stays valid, from 5m to 24h. The default is 2h |
permit |
How PERMITs are signed: signing (hmac, the default, or sigstore), and for sigstore the identity, issuer and repository. See Sigstore signing. Operations PERMITs share its identity, issuer and repository |
operations |
Settings for operations PERMITs |
rego |
files, a list of Rego policy files that gate runs after the built-in rules. See Rego rules |
actors |
Accepted by the schema. No command reads it yet |
policy:
permit_ttl: 2h
windows:
prod: [{ days: [tue, thu], from: "18:00", to: "22:00", tz: America/Chicago }]
blackouts:
- { from: "2026-12-20", to: "2027-01-03", tiers: [prod], reason: holiday freeze }
rules:
coverage_min: 75
analyzer_max_severity: 2
destructive_needs_label: { label: destructive-ok, tiers: [prod] }
separation_of_duties:
tiers: [prod]
approval: { environment: glassops-deploy }
policy.operations
These apply only to an operations PERMIT, made by gate --ops. The calendar itself stays in windows and blackouts, and these switches say whether it applies to operations. The Sigstore repository always comes from policy.permit.
| Key | Default | Meaning |
|---|---|---|
ttl |
15m |
How long an operations PERMIT stays valid, a Go duration from 1m to 24h. It is still cut short by a blackout start, and by a window end when window is on |
signing |
the value of policy.permit.signing |
hmac or sigstore. sigstore makes operations require a Sigstore signature, and needs an identity and an issuer, here or under policy.permit. An HMAC PERMIT is then refused. Deploys keep using policy.permit.signing |
identity |
the value of policy.permit.identity |
The certificate identity a Sigstore operations PERMIT must carry. Set it when operations are signed in a different workflow from deploys, such as a scheduled workflow, because one identity names one workflow. Refused when operations are signed with HMAC |
issuer |
the value of policy.permit.issuer |
The OIDC issuer for identity. Refused when operations are signed with HMAC |
branch |
main |
The branch an operations run must be on, used only when the CI does not report the repository's default branch. GitHub Actions and GitLab report it |
window |
false |
Whether the window rule applies to operations. A heartbeat at 3am is normal, so it does not by default |
blackout |
true |
Whether the blackout rule applies to operations. A freeze should stop writes |
policy:
permit:
signing: sigstore
identity: https://github.com/glassops-platform/glassops/.github/workflows/glassops-deploy.yml@refs/tags/v1
issuer: https://token.actions.githubusercontent.com
repository: acme/app
operations:
ttl: 10m
identity: https://github.com/acme/app/.github/workflows/keepalive.yml@refs/heads/main
blackout: true
Here deploys run in the GlassOps reusable workflow and operations run in the project's own scheduled workflow, so each kind names its own identity. Both are pinned to acme/app.
operations
Named commands for a long lived target that are not part of a deploy, such as a heartbeat query or a cache refresh. Each is declared once, so config_sha256 binds its command and the change that added it went through the repository's normal review. gate --ops issues the PERMIT for them, and an exec step names one with op. Names follow the same rule as every other name: lowercase letters, digits, _ and -, starting with a letter.
| Field | Required | Meaning |
|---|---|---|
target |
yes | A name under targets. A name that is only under environments is refused, because an operation is for a long lived org. A target of tier ephemeral is refused by gate --ops |
run |
yes | A string is a shell command, run with sh -c. A list is the program and its arguments, run with no shell. The PERMIT binds its SHA-256, never the text |
params |
no | The values a list run takes. See Operation params |
login |
no | One of the target's named logins. It must be defined under targets.<target>.logins |
writes |
no | true when the command may change records. It is evidence only, because GlassOps cannot see what a command does to the org |
schedule_ok |
no | true when the operation may run with no person approving at run time, such as from a cron job. The reviewed config on the default branch is its approval |
operations:
heartbeat:
target: prod
run: node scripts/heartbeat.js
writes: true
schedule_ok: true
refresh-docs-cache:
target: prod
run: sf apex run --target-org glassops-target --file scripts/refresh-docs-cache.apex --json
login: integration
writes: true
pipelines:
keepalive:
- gate --ops heartbeat
- step: exec
op: heartbeat
The config check refuses an operation with no run or target, a target that is not a configured target, a login the target does not define, and a step that names an operation that is not declared.
Operation params
A list run may take values that change from run to run, such as which site to publish or which Apex file to run. Each value is given to gate --ops with --param, checked against its limits, and recorded in the signed PERMIT. The op step and glassops op take the values only from the PERMIT, so the run is exactly the command that was approved. A new value needs a new gate.
operations:
publish-site:
target: prod
run: [sf, community, publish, --name, "{site}", --json]
params:
site: { enum: [Portfolio] }
writes: true
run-apex:
target: prod
login: integration
run: [sf, apex, run, --file, "{script}", --json]
params:
script: { file: true, pattern: '^scripts/apex/[a-z0-9-]+\.apex$' }
writes: true
A placeholder is {name} inside a list element. It may be the whole element or part of one, such as --name={site}. Either way the element stays one argument, whatever the value holds, and no shell reads it. Write {{ and }} for a literal { and }. Every placeholder must be declared under params, and every declared param must be used. A string run takes no params, so use the list form for a command with values. Pipes, redirects and && belong in a committed script that takes the values as its arguments.
Each param sets at least one limit:
| Field | Meaning |
|---|---|
enum |
A list of the only values allowed. Not empty |
pattern |
A Go RE2 expression the whole value must match. It is anchored at both ends, so [a-z]+ is read as ^(?:[a-z]+)$. It is compiled when the config loads |
file |
true makes the value a clean relative path to a file tracked in git at the PERMIT's commit: no .., no absolute path, no backslash, no colon and no leading -. The PERMIT also records the file's blob, so its contents are bound. The file in the working tree must be byte for byte the committed file, so check it out with no line ending conversion, for example -text or eol=lf for those paths in .gitattributes. It can be combined with pattern |
default |
Optional. The value gate --ops uses when no --param gives one, such as for a schedule_ok operation run from a schedule. It must pass the param's own limits |
Every value, whatever its limits, is at most 256 bytes, valid UTF-8 and free of NUL bytes. A value that starts with - is refused unless enum lists it, so a value cannot add an option to the command. A pattern is checked on its own before it is anchored, so a pattern such as a)|(b that would close the group early is refused.
The first element of a list run is the program, and it cannot hold a placeholder, so a value never picks what runs. On Windows, a program that resolves to a .cmd or .bat file runs through cmd.exe, which reads some characters as syntax. Such an operation refuses to run, before any login, when an argument after the program holds any of " % & | < > ^ ! ( ), a carriage return, a line feed or a tab.
salesforce
| Field | Meaning |
|---|---|
test_level |
Map of tier to the test level validate and deploy use: NoTestRun, RunSpecifiedTests, RunLocalTests, RunRelevantTests or RunAllTestsInOrg. RunRelevantTests is a beta Salesforce test level that runs the tests Salesforce picks from the Apex in the change set, so a change set with no Apex runs none (see PERMIT and rules). The default key applies to any tier not listed |
delta.enabled |
false makes plan list the whole source instead of a delta. It is the project default, and a target's plan.scope wins over it |
deploy.quick |
prefer (the default), require or off. See validation binding |
ephemeral.seed |
minimal (the default), full or off. See the smart seed |
engine |
native, the default and the only engine |
api_version |
Accepted by the schema (auto or a version such as 62.0). No command reads it yet |
salesforce:
test_level: { default: RunLocalTests, prod: RunLocalTests }
deploy: { quick: prefer }
ephemeral: { seed: minimal }
environments
One entry per ephemeral environment, keyed by the target name the environment registers as. The default pr pipeline uses the name ephemeral. See env create.
| Field | Meaning |
|---|---|
devhub |
The target that creates the environment (required) |
definition |
Scratch definition file, relative to the project root |
ttl_days |
Days the environment lives. The default is 1 |
shape |
Source org Id for an org shape, or a $VAR holding one |
prefix |
Starts every environment name. The default is glassops |
reserve.api_requests |
Makes env create check the Dev Hub's limits before it creates anything. See below. Not set by default, and then no check and no extra call happen |
environments:
ephemeral:
devhub: devhub
definition: config/project-scratch-def.json
ttl_days: 1
reserve:
api_requests: 0.4
reserve.api_requests is how many of the hub's daily API requests must stay left. A value above 0 and below 1 is a share of the daily cap, rounded up, so 0.4 keeps 40 percent. A value of 1 or more is a whole number of requests. 0, a negative number, a fraction above 1 such as 1.5, and text are refused when the config loads. The check also needs one daily and one active scratch org left. See env create.
test
Settings for glassops test.
| Field | Meaning |
|---|---|
level |
Map of tier to test level, with a default key. The --level flag overrides it |
coverage.org_min |
Minimum org-wide coverage, 0 to 100 |
coverage.class_min |
Minimum coverage for each class the test run reports, 0 to 100 |
coverage.class_scope |
Which classes no test touched count at 0%: changed (the default) or all. See Verify, coverage and YAML settings |
check
Scripts that glassops check runs with sh -c.
analyze
Settings for glassops analyze. Nothing runs until enabled is true.
| Field | Meaning |
|---|---|
enabled |
true turns analyze on. It also needs the glassops-analyzer image |
rule_selector |
Code Analyzer rules to run. The default is Recommended |
max_severity |
The default for policy.rules.analyzer_max_severity, 1 (critical) to 5. The policy value wins when both are set |
tools
What glassops setup installs. config_sha256 binds it, so a change to the list goes through review like any other change.
tools:
sf:
plugins:
"@salesforce/plugin-flow": 2.0.1
sfdx-git-delta: { version: 6.1.0, unsigned: true }
Each entry under tools.sf.plugins is an sf plugin's npm package name and one exact version. A range such as ^2.0.1 is refused. sf asks before it installs a plugin that is not digitally signed, and setup answers yes only for an entry with unsigned: true, so an unsigned plugin is refused unless the config allows it.
An exec step that runs with a target, an op step and glassops op refuse before any login when a listed plugin is not installed at its version, with a hint to run glassops setup. glassops doctor reports each plugin's installed version against the configured one. Plugins need provider salesforce.
Every sf command GlassOps runs, and setup's install, starts without GLASSOPS_PERMIT_KEY, ACTIONS_ID_TOKEN_REQUEST_URL and ACTIONS_ID_TOKEN_REQUEST_TOKEN, because a plugin's code can run on any sf command.
setup installs into sf's data directory. The glassops image sets SF_DATA_DIR for that. Outside the image, set SF_DATA_DIR too, because a step with a target runs sf with the session's own home directory, and sf would not find plugins installed under the job's home.
pipelines
Named lists of steps for glassops run. Each step is a string (a glassops command line without the glassops prefix) or a map with step, optional when (success, failure or always) and, for the step exec, a run shell command, an optional target and, with a target, an optional login. A pipeline needs at least one step.
An exec step with target runs its command logged in to that target, a name under targets or environments. See exec steps with a target. On any tier but ephemeral it needs a PERMIT from gate --exec-command that binds the command.
An exec step may set op: <name> instead of run, target and login. It then takes its command, target and login from that operation, so the gate binding and the step text cannot drift apart. A list run takes its values from the PERMIT. op cannot be combined with run, target or login, and the name must be declared under operations, which the config check enforces when the config loads. A step with op runs with an operations PERMIT, from gate --ops.
An exec step with login logs in with that named login of the target instead of the target's own auth. login needs target, and the name must be one the target defines under logins, which the config check enforces when the config loads. A login on a step whose target is only under environments, or on a step that is not exec, is refused. The guard still runs, so the org must be the target's org Id, and the PERMIT check is the same as without login.
pipelines:
pr:
- plan
- check
- step: exec
run: npm run build
- step: report
when: always
deploy:
- plan --target prod
- validate --target prod
- gate --target prod --exec-command "node scripts/api-check.js"
- step: exec
run: node scripts/api-check.js
target: prod
- deploy --target prod
The default pr and deploy pipelines apply only when the project has no glassops.yaml. A file that has a pipelines key replaces them, and one without the key has no pipelines, so glassops run pr fails with an unknown pipeline. glassops init writes the defaults into the file. See Run a pipeline.