Ordinary public path
mars auth github check --json
No credentials are resolved for a successful anonymous request, a redirect, transport failure, unexpected status, or custom origin.
Secret-safe operation
MARS keeps credentials local and explicit. Official GitHub release metadata is anonymous-first; optional auth supports private forks and rate-limit fallback. Model provider credentials unlock cloud or hosted inference routes. Integration secrets verify optional webhooks and external board reads. Repo configuration stores names and policy, not raw secret values.
Start with the capability you want, then choose the narrowest credential path. Do not reuse a token just because it happens to work for another surface.
| Capability | Credential source | Primary command or file | Commit? |
|---|---|---|---|
| Read official MARS release metadata | None by default; GH_TOKEN, GITHUB_TOKEN, GitHub CLI auth, or local fallback only after an exact official access denial. | mars auth github check; optional setup for private forks or rate limits. | No token values; access classification proves access only. |
| Use cloud model routes | Provider API key in process env or ignored target-local env file. | api_key_env, mars models credentials write-local-env. | Commit env names only. |
| Use local llama.cpp models | No provider key; local model files under ~/.mars/models/. | mars setup, mars models eligible. | No model files. |
| Use optional GitHub code-host integration | PAT or GitHub App credentials depending on integration mode. | Integration config and local credential storage. | Commit config only when it contains no secret values. |
| Use optional JIRA or Atlassian MCP reads | Environment variables named from integration config. | .harness/integrations.yaml fields such as webhook_secret_env. | Commit env-var names only. |
| Detect accidental secret leaks | No credential needed. | mars guardrails secret-scan. | Commit findings only after redaction. |
~/.mars/, or
ignored local files. Repo files may name the variable, provider,
endpoint, trust policy, or integration profile.
mars auth github check first makes one exact,
no-redirect anonymous request to the official
api.github.com release-metadata endpoint. Only an exact
401, 403, or 404 may resolve
optional credentials and retry the same origin and path once. The
result is classified as anonymous,
authenticated, or unavailable without
disclosure. Credential availability does not authorize publication
or prove artifact authenticity. Source signing and publication stay
blocked until the approved F-018 cutover workflow; this credential
path is separate from target model or board integration credentials.
mars auth github check --json
No credentials are resolved for a successful anonymous request, a redirect, transport failure, unexpected status, or custom origin.
gh auth login
mars auth github setup
mars auth github check --json
When fallback is eligible, GH_TOKEN and
GITHUB_TOKEN are checked before GitHub CLI auth and
the optional local config token. Do not echo or log token values.
mars auth github setup --token "$GH_TOKEN"
Use this for headless installs when GitHub CLI auth is not available. Prefer GitHub CLI auth on interactive machines.
mars auth github setup --config /private/tmp/mars-config.yaml
mars auth github check --config /private/tmp/mars-config.yaml --json
mars auth github clear-local --config /private/tmp/mars-config.yaml
Useful for validation or temporary machines where you do not
want to update the default ~/.mars/config.yaml.
| Command | Flags | Output contract |
|---|---|---|
mars auth github check | --config, --json. | Reports anonymous, authenticated, or unavailable without revealing credentials. |
mars auth github setup | --config, --json, --token. | Verifies access before persisting a fallback. Token values are never printed. |
mars auth github clear-local | --config, --json. | Removes only the stored config github_token; it does not touch environment variables, GitHub CLI or GitHub App credentials, repositories, or remote state. Repeated runs are safe. |
Cloud and hosted model routes use an api_key_env name.
MARS resolves the actual key from the process environment or from
ignored .harness/.env.local. Serializable routing data
keeps provider, model, endpoint, and env-var name; it does not carry
the API key value.
export ANTHROPIC_API_KEY=...
mars models evaluate \
--provider anthropic \
--model claude-sonnet-family \
--api-key-env ANTHROPIC_API_KEY
Best for short-lived shells, CI jobs, and operators who already manage env vars.
export ANTHROPIC_API_KEY=...
mars models credentials write-local-env \
--repo ~/my-project \
--api-key-env ANTHROPIC_API_KEY \
--yes \
--json
The command reads the value from the current process
environment, writes ignored .harness/.env.local
with owner-only permissions, and updates
.harness/.env.example with the name only.
mars models override \
--repo ~/my-project \
--role engineer \
--provider openai \
--model gpt-4.1 \
--api-key-env OPENAI_API_KEY
Review generated config for env-var names and endpoints before committing.
| File or field | Meaning | Commit? |
|---|---|---|
.harness/model-overrides.yaml | Provider, model, endpoint, routing tier or role, and api_key_env. | Yes, when the target repo should use that route. |
.harness/.env.example | Example env-var names with empty values. | Yes. |
.harness/.env.local | Local provider key values. | No; ignored and owner-only. |
| Process environment | Temporary or externally managed provider key values. | No. |
Provider names and default env vars come from the model provider catalog. OpenAI-compatible endpoints can use a user-supplied env var name because the endpoint is operator-defined.
| Provider | Default endpoint | Default env var | Runtime status |
|---|---|---|---|
| OpenAI | https://api.openai.com/v1 | OPENAI_API_KEY | Selectable. |
| Anthropic | https://api.anthropic.com/v1 | ANTHROPIC_API_KEY | Selectable. |
| Gemini | https://generativelanguage.googleapis.com/v1beta/openai | GEMINI_API_KEY | Selectable through OpenAI-compatible adapter. |
| Mistral | https://api.mistral.ai/v1 | MISTRAL_API_KEY | Selectable. |
| xAI | https://api.x.ai/v1 | XAI_API_KEY | Selectable. |
| DeepSeek | https://api.deepseek.com/v1 | DEEPSEEK_API_KEY | Selectable. |
| Groq | https://api.groq.com/openai/v1 | GROQ_API_KEY | Selectable. |
| Cohere | https://api.cohere.com/v2 | COHERE_API_KEY | Cataloged, but not runtime-selectable until native tool-call fixtures exist. |
| OpenAI-compatible | User supplied. | User supplied. | Selectable. |
| Ollama | http://127.0.0.1:11434/v1 | None by default. | Selectable local provider. |
Optional code-host, JIRA, and Atlassian MCP integrations use environment-variable indirection. Config can name the variable that contains a webhook secret, base URL, API token, or provider credential, but repo-owned config must not contain the value. Keeping credentials out of repo-owned config does not keep either authentication or integration data on-device during use. The selected service receives authentication material according to its protocol, and configured services receive the scoped repository, work-item, tool, and request data needed to perform each operation.
| Integration surface | What config may contain | Local storage boundary and use |
|---|---|---|
| GitHub code-host client | Auth mode, base URL, app or PAT mode metadata. | Secret values stay out of repo config. PATs, signed App assertions, and installation credentials are transmitted to the configured GitHub endpoint as required by its authentication protocol. |
| GitHub webhook receiver | Whether a webhook receiver is enabled and which repo it maps to. | The webhook secret is stored locally and used to verify incoming signatures; configured GitHub webhook deliveries carry event content. |
| JIRA mirror | Project mapping, allowed workspaces, labels, JQL shape, env-var field names. | Tokens stay out of repo config but are transmitted to the configured JIRA endpoint for authentication; account and work-item data is exchanged for the request. |
| Atlassian MCP | Provider mode, proxy command, endpoint, allowed tool names, env-var field names. | OAuth/session credentials and scoped tool data are sent according to the configured MCP or Atlassian authentication protocol. |
| Future design or board integrations | Scope gates and env-var names. | Service and refresh tokens stay out of repo config but may be transmitted for authentication; selected customer data leaves the machine only when the configured operation requires it. |
Secret-safe operation depends on knowing which files are repo-owned contracts and which files are machine-local state.
| Location | Contains | Rule |
|---|---|---|
~/.mars/config.yaml | Machine-local MARS config and optional private-release auth fallback. | Do not commit; keep owner-readable. |
~/.mars/models/ | Downloaded local model artifacts. | Never commit; large local runtime state. |
~/.mars/bin/ | Managed helper binaries. | Never commit. |
.harness/.env.local | Target-local model provider key values. | Ignored; never commit. |
.harness/.env.example | Target-local credential names with empty values. | Commit when useful for onboarding. |
.harness/integrations.yaml | Optional integration profile and env-var names. | Commit only after confirming it contains no secret values or tenant-private data. |
docs/validation/reports/ | Evidence and blocker reports. | Commit only redacted evidence; never raw tokens. |
~/.mars/traces/ | Local command logs and traces. | Do not paste or commit blindly; inspect for sensitive local context first. |
Treat terminal output, JSON, traces, tickets, docs, screenshots, and chat as potentially durable. MARS commands aim to print remediation and env-var names rather than secret values, but users still need to avoid leaking shell-expanded values.
export OPENAI_API_KEY=<secret>
mars models credentials write-local-env --repo . --api-key-env OPENAI_API_KEY --yes
Never replace <secret> with a real value in documentation or tickets.
mars guardrails secret-scan --repo .
mars guardrails secret-scan --repo . --staged --json
Remove the value and rotate the secret if a real credential was staged or committed.
mars guardrails install-hooks --repo .
git status --short
The managed pre-commit hook runs the staged secret scan locally.
Verify credentials by the capability they unlock, not by printing the credential. Prefer JSON when another agent or script needs to decide the next action.
| Question | Command | Passing signal |
|---|---|---|
| Can MARS read official release metadata? | mars auth github check --json | Access class reports anonymous, authenticated, or unavailable; this proves access only, not signature, commit, or archive validity. |
| Does the source release match its producer contract? | Run the no-publish steps authorized by AD-315 before tagging; the T-080 workflow is tag-only and least privilege. | Four archives, four SBOMs, and the exact checksum contract pass before an approved tag can publish. |
| Is a packaged update admissible? | Run the approved F-018 signed consumer lifecycle. | Signature, workflow identity, immutable commit, platform/build metadata, checksum, archive, and replacement gates all pass. |
| Can a cloud route authenticate? | mars models evaluate --provider openai --model ... --api-key-env OPENAI_API_KEY | Evaluation reaches the provider without missing credential errors. |
| Did local env writing work? | mars models credentials write-local-env --repo . --api-key-env OPENAI_API_KEY --yes --json | Ignored local file is written, example contains the env name only. |
| Did a repo gain a leaked secret? | mars guardrails secret-scan --repo . --json | No findings, or findings are removed and rotated before commit. |
make install
mars setup
mars doctor
Ordinary setup does not require GitHub credentials.
gh auth login
mars auth github setup
mars auth github check --json
Access does not make a packaged update available or valid. Source checkout remains the supported route until the approved signed cutover release exists.
export OPENAI_API_KEY=<secret>
mars models credentials write-local-env \
--repo ~/my-project \
--api-key-env OPENAI_API_KEY \
--yes \
--json
git -C ~/my-project status --short
Expect .harness/.env.local to stay ignored and .harness/.env.example to contain only the name.
mars guardrails secret-scan --repo ~/my-project --json
git -C ~/my-project status --short
Remove the value, rotate the credential if it was real, then rerun the scan before committing.
| Symptom | Likely cause | Recovery |
|---|---|---|
mars auth github check reports unavailable. | The anonymous official request failed, or an eligible authenticated retry was not accepted. | Check connectivity first; configure optional credentials only for a private fork or rate-limit fallback. |
mars update tool cannot download assets. | Release access is unavailable or the signed asset contract is absent. | Run mars auth github check --json and follow the remediation. |
| Cloud route says credential env is not set. | The configured api_key_env is absent from the process environment and .harness/.env.local. | Export the env var or run mars models credentials write-local-env after exporting it. |
models credentials write-local-env fails. | --repo is missing, .harness/ is missing, or the named env var is not set. | Run mars init --repo ..., export the env var, and retry with --yes --json. |
| Secret scan reports a finding. | A repo file or staged file looks like a token, password, or API key. | Remove the value, rotate the real credential, rerun the scan, and review git history if it was committed. |
| Integration webhook signature fails. | The configured env var is missing or points to the wrong secret for the mapped repo. | Check the env-var name in integration config, export the correct value locally, and retry without logging it. |
| Telemetry or validation report may contain sensitive context. | A report copied local logs, traces, env output, or service payloads too broadly. | Redact values and tenant-private payloads before committing evidence. |
For setup failures, use the Install And Setup Reference. For model routing, use the Models And Inference Guide. For secret scanning and trust controls, use the Safety, Trust, And Quality Guide.