Skip to content

Commit bcfa427

Browse files
committed
Add agent authentication documentation
- Related to laude-institute/harbor#173
1 parent 404c981 commit bcfa427

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

content/docs/agents.mdx

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,28 @@ harbor run --help
1515

1616
Right now, Harbor includes Terminus-2, Claude Code, Codex CLI, Gemini CLI, OpenHands, Mini-SWE-Agent, and more.
1717

18+
## Agent Authentication
19+
20+
Some agents require authentication via environment variables, often requiring to export their API key. E.g., ANTHROPIC_API_KEY in case of Claude Code, OPENAI_API_KEY in case of Codex CLI, GEMINI_API_KEY in case of Gemini CLI.
21+
22+
### Claude Code Pro/Max subscribers
23+
Claude Code Pro/Max subscribers can also use OAuth tokens via `CLAUDE_CODE_OAUTH_TOKEN`. The token location varies by operating system:
24+
25+
- **Linux**: Claude stores credentials in `~/.claude/.credentials.json`
26+
```bash
27+
export CLAUDE_CODE_OAUTH_TOKEN=$(jq -r '.claudeAiOauth.accessToken' ~/.claude/.credentials.json)
28+
```
29+
30+
- **macOS**: Claude stores credentials in Keychain
31+
```bash
32+
export CLAUDE_CODE_OAUTH_TOKEN=$(security find-generic-password -s "Claude Code-credentials" -a "$USER" -w | jq -r '.claudeAiOauth.accessToken')
33+
```
34+
35+
Then run Harbor commands as normal:
36+
```bash
37+
harbor run -d "<dataset@version>" -m "<model>" -a claude-code
38+
```
39+
1840
## Integrating your own agent
1941

2042
Harbor supports integrating your own agent without having to modify the Harbor source code.

0 commit comments

Comments
 (0)