Problem
A type: anthropic secret (Claude subscription OAuth token) granted to an agent via the dashboard's agent-grants UI (LLMs tab, toggle on) is never actually injected. Every call 401s with credential_not_found, even though the grant is correctly saved and shown as attached.
Steps to Reproduce
onecli secrets create --name Anthropic --type anthropic --value sk-ant-oat01-... --host-pattern api.anthropic.com
- Dashboard → Agents → Default Agent → LLMs tab → toggle the secret on (confirmed via network tab:
PUT /v1/agents/<id>/grants/secrets/<secretId> → 200 OK)
onecli run -- claude -p "hi"
Expected Behaviour
Claude Code authenticates using the granted credential and responds normally.
Observed Behaviour
onecli: gateway connected. Starting claude...
Failed to authenticate. API Error: 401 No credentials configured for api.anthropic.com in OneCLI.
Also reproduces with a bare curl through the gateway (no onecli run, no Claude Code), using the agent's own access token:
curl -sS -x http://<agent-access-token>@localhost:10255 \
--cacert /tmp/onecli-ca.pem \
-X POST https://api.anthropic.com/v1/messages \
-H "x-api-key: placeholder" -H "anthropic-version: 2023-06-01" -H "content-type: application/json" \
-d '{"model":"claude-sonnet-5","max_tokens":10,"messages":[{"role":"user","content":"hi"}]}'
# -> {"error":"credential_not_found", ...} HTTP 401
Reproduces identically for the Default Agent and a second, custom-created agent — not specific to one agent identity.
I checked the underlying data directly in Postgres (secret + agent share the same project_id, the policy_rules_v2 grant rule is published/enabled at the current max generation for the project, with matching policy_rule_identities/policy_rule_targets rows) — the grant looks correctly configured, but injection still never happens.
Environment
- Self-hosted (
curl -fsSL onecli.sh/install | sh), single-project local install
- Gateway: pulled
ghcr.io/onecli/onecli:1.36.0, but /api/health reports "version":"1.45.0"
onecli CLI 2.2.5
- Credential: Claude Pro/Max subscription token via
claude setup-token
Problem
A
type: anthropicsecret (Claude subscription OAuth token) granted to an agent via the dashboard's agent-grants UI (LLMs tab, toggle on) is never actually injected. Every call 401s withcredential_not_found, even though the grant is correctly saved and shown as attached.Steps to Reproduce
onecli secrets create --name Anthropic --type anthropic --value sk-ant-oat01-... --host-pattern api.anthropic.comPUT /v1/agents/<id>/grants/secrets/<secretId>→ 200 OK)onecli run -- claude -p "hi"Expected Behaviour
Claude Code authenticates using the granted credential and responds normally.
Observed Behaviour
Also reproduces with a bare
curlthrough the gateway (noonecli run, no Claude Code), using the agent's own access token:Reproduces identically for the Default Agent and a second, custom-created agent — not specific to one agent identity.
I checked the underlying data directly in Postgres (secret + agent share the same
project_id, thepolicy_rules_v2grant rule ispublished/enabledat the current max generation for the project, with matchingpolicy_rule_identities/policy_rule_targetsrows) — the grant looks correctly configured, but injection still never happens.Environment
curl -fsSL onecli.sh/install | sh), single-project local installghcr.io/onecli/onecli:1.36.0, but/api/healthreports"version":"1.45.0"onecliCLI 2.2.5claude setup-token