Skip to content

Commit 0e12195

Browse files
chaodu-agentchaodu-agent
andauthored
docs(kiro): add API key as recommended auth (#1178)
* docs(kiro): add API key as recommended auth method - Add step-by-step setup guide for KIRO_API_KEY via AWS Secrets Manager - Demote OAuth device flow to legacy/alternative - Zero-touch deployment: no manual login required * docs(kiro): add mermaid sequence diagram for API key auth flow * docs(kiro): add ASCII block diagram for auth flow * Update kiro.md * Update kiro.md --------- Co-authored-by: chaodu-agent <chaodu-agent@openab.dev>
1 parent ebc2d12 commit 0e12195

1 file changed

Lines changed: 93 additions & 1 deletion

File tree

docs/kiro.md

Lines changed: 93 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,99 @@ helm install openab openab/openab \
3131

3232
## Authentication
3333

34-
Kiro CLI requires a one-time OAuth login. The PVC persists tokens across pod restarts.
34+
### Recommended: API Key (No Login Required)
35+
36+
Kiro CLI supports API key authentication via the `KIRO_API_KEY` environment variable. This is the **recommended** approach — it requires no manual OAuth login and is fully managed by AWS Secrets Manager.
37+
38+
#### Setup Steps
39+
40+
1. **Enable API Keys in AWS Console** — Go to your AWS Console and search for "Kiro". Enable the API Keys feature. This option is only available through the AWS Console.
41+
2. **Generate your API Key** — Go to [kiro.dev](https://kiro.dev), log in, and generate your API key.
42+
3. **Store the key in AWS Secrets Manager** — Create a generic secret (e.g. secret name `kiro`) and store your API key as a key/value pair (e.g. key: `API_KEY`, value: your generated key).
43+
4. **Configure AWS credentials** — Make sure your runtime environment has AWS CLI or AWS credentials configured so OpenAB can retrieve the secret.
44+
5. **Configure `config.toml`** — Add the secret reference and environment variable:
45+
46+
```toml
47+
[secrets.refs]
48+
kiro_api_key = "aws-sm://kiro#API_KEY"
49+
50+
[agent]
51+
env = { KIRO_API_KEY = "${secrets.kiro_api_key}" }
52+
```
53+
54+
That's it — you're all set. No OAuth login required.
55+
56+
#### Architecture
57+
58+
```
59+
┌─────────────────────────────────────────────────────────────────┐
60+
│ One-time Setup │
61+
├─────────────────────────────────────────────────────────────────┤
62+
│ │
63+
│ ┌───────────────┐ ┌───────────┐ ┌────────────────┐ │
64+
│ │ AWS Console │ │ kiro.dev │ │ AWS Secrets Mgr│ │
65+
│ │ │ │ │ │ │ │
66+
│ │ Enable Kiro │ │ Generate │ │ Secret: "kiro" │ │
67+
│ │ API Keys │ │ API Key │─────▶│ Key: API_KEY │ │
68+
│ └───────────────┘ └───────────┘ │ Val: sk-xxxxx │ │
69+
│ ① ② └───────┬────────┘ │
70+
│ │ ③ │
71+
└────────────────────────────────────────────────────┼────────────┘
72+
73+
┌────────────────────────────────────────────────────┼────────────┐
74+
│ Runtime (automatic) │ │
75+
├────────────────────────────────────────────────────┼────────────┤
76+
│ │ │
77+
│ ┌──────────────────────┐ ④ resolve │ │
78+
│ │ OpenAB │◀──────────────────-──────┘ │
79+
│ │ │ aws-sm://kiro#API_KEY │
80+
│ │ config.toml: │ │
81+
│ │ env = { KIRO_API_KEY│ │
82+
│ │ = "${secrets...}"}│ │
83+
│ └──────────┬───────────┘ │
84+
│ │ ⑤ inject env │
85+
│ ▼ │
86+
│ ┌──────────────────────┐ ⑥ authenticate │
87+
│ │ Kiro CLI │────────────────────────▶ Kiro API │
88+
│ │ │ KIRO_API_KEY ✅ │
89+
│ │ No login needed! │ │
90+
│ └──────────────────────┘ │
91+
│ │
92+
└─────────────────────────────────────────────────────────────────┘
93+
```
94+
95+
```mermaid
96+
sequenceDiagram
97+
participant User as User (one-time setup)
98+
participant Console as AWS Console
99+
participant Kiro as kiro.dev
100+
participant SM as AWS Secrets Manager
101+
participant OAB as OpenAB
102+
participant CLI as Kiro CLI
103+
104+
Note over User,SM: One-time setup
105+
User->>Console: 1. Enable Kiro API Keys
106+
User->>Kiro: 2. Generate API Key
107+
User->>SM: 3. Store key in secret "kiro" (key: API_KEY)
108+
109+
Note over OAB,CLI: Runtime (automatic)
110+
OAB->>SM: 4. Resolve aws-sm://kiro#API_KEY
111+
SM-->>OAB: Return API key value
112+
OAB->>CLI: 5. Inject as KIRO_API_KEY env var
113+
CLI->>Kiro: 6. Authenticate with API key ✅
114+
```
115+
116+
#### How It Works
117+
118+
1. OpenAB starts and resolves `aws-sm://kiro#API_KEY` — fetches the `API_KEY` field from the AWS Secrets Manager secret named `kiro`.
119+
2. The resolved value is injected into the agent container as the `KIRO_API_KEY` environment variable.
120+
3. Kiro CLI detects `KIRO_API_KEY` and uses it directly — **no OAuth flow, no device code, no manual intervention**.
121+
122+
This makes the entire Kiro deployment **zero-touch** — fully automated with no login step required.
123+
124+
### Alternative: OAuth Device Flow (Legacy)
125+
126+
If you cannot use an API key, Kiro CLI falls back to the OAuth device code flow. The PVC persists tokens across pod restarts.
35127

36128
```bash
37129
kubectl exec -it deployment/openab-kiro -- sh -c "$OPENAB_AGENT_AUTH_COMMAND"

0 commit comments

Comments
 (0)