Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
9babf85
docs: add least-privilege deployment roles and deployment guide
scottschreckengaust Apr 23, 2026
94e5579
fix(docs): preserve original reference order in COST_MODEL.md
scottschreckengaust Apr 23, 2026
ee32d47
fix(docs): restore dual COMPUTE.md references in COST_MODEL.md
scottschreckengaust Apr 23, 2026
e0789d8
fix(docs): consolidate COMPUTE.md references with section anchor
scottschreckengaust Apr 23, 2026
5b8e560
fix(docs): replace iamlive with IAM Access Analyzer recommendation
scottschreckengaust Apr 23, 2026
f506b4e
fix: remove sub section
scottschreckengaust Apr 23, 2026
19c188d
fix(docs): add generated Starlight mirrors for new and modified docs
scottschreckengaust Apr 23, 2026
0a48dba
fix: add docs-sync pre-commit hook and strengthen agentic instructions
scottschreckengaust Apr 23, 2026
55f04a0
fix(docs): correct session timeout and concurrency defaults in COST_M…
scottschreckengaust Apr 23, 2026
c7df384
chore: gitignore Claude Code plugin artifacts (.mcp.json, .remember/)
scottschreckengaust Apr 23, 2026
dbdc126
fix(docs): add X-Ray resource policy prerequisite and build credentia…
scottschreckengaust Apr 23, 2026
544cbf2
fix(plugin): add X-Ray resource policy to /setup and least-privilege …
scottschreckengaust Apr 23, 2026
ad18fcc
fix(docs): replace IaCRole-ABCA with validated 3-way policy split
scottschreckengaust Apr 23, 2026
060da61
fix(docs): note ECS policy fits under IAM size limit
scottschreckengaust Apr 23, 2026
bc9e50e
Merge branch 'main' into least-privilege-deployment-documentation
scottschreckengaust Apr 24, 2026
14a197b
fix(docs): document SecretsManager GetRandomPassword Resource:"*" in …
scottschreckengaust Apr 24, 2026
80ff90c
fix(plugin): update /deploy skill to reference 3-way policy split
scottschreckengaust Apr 24, 2026
0011375
fix(docs): add DEPLOYMENT_GUIDE.md Starlight mirror and sidebar entry
scottschreckengaust Apr 24, 2026
d02311f
fix(docs): split SecretsManager GetRandomPassword into own statement
scottschreckengaust Apr 24, 2026
ca33f47
fix(docs): add PassedToService condition to PassRole and tightening n…
scottschreckengaust Apr 24, 2026
6df700d
fix(docs): scope X-Ray resource policy, add KMS tightening, unify pla…
scottschreckengaust Apr 24, 2026
abe2a90
fix(docs): correct VPC endpoint cost to ~$102/mo and clarify session …
scottschreckengaust Apr 24, 2026
3adb6e2
fix(docs): add GitHubTokenSecret to SecretsManager resource scope
scottschreckengaust Apr 25, 2026
6cd306b
fix(docs): add vpc-flow-logs and bedrock-agentcore to PassedToService
scottschreckengaust Apr 25, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,14 @@ repos:
files: ^agent/.*\.py$
stages: [pre-commit]

- id: docs-sync
name: sync docs → Starlight mirrors
entry: bash -lc 'cd "$(git rev-parse --show-toplevel)/docs" && node scripts/sync-starlight.mjs && git add src/content/docs/'
language: system
pass_filenames: false
files: ^(docs/(design|guides)/.*\.md$|CONTRIBUTING\.md$)
stages: [pre-commit]

- id: docs-astro-check
name: astro check (docs)
entry: bash -lc 'cd "$(git rev-parse --show-toplevel)/docs" && ./node_modules/.bin/astro check'
Expand Down
5 changes: 3 additions & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ Handler entry tests: `cdk/test/handlers/orchestrate-task.test.ts`, `create-task.
### Common mistakes

- Editing **`docs/src/content/docs/`** instead of **`docs/guides/`** or **`docs/design/`** — content is generated; sync from sources.
- Adding or editing files in **`docs/design/`** or **`docs/guides/`** without running **`cd docs && node scripts/sync-starlight.mjs`** — CI will reject ("Fail build on mutation") because the Starlight mirror files in `docs/src/content/docs/` are stale. Always commit the regenerated mirrors alongside source changes.
- Changing **`cdk/.../types.ts`** without updating **`cli/src/types.ts`** — CLI and API drift.
- Running raw **`jest`/`tsc`/`cdk`** from muscle memory — prefer **`mise //cdk:test`**, **`mise //cdk:compile`**, **`mise //cdk:synth`** (see [Commands you can use](#commands-you-can-use)).
- **`MISE_EXPERIMENTAL=1`** — required for namespaced tasks like **`mise //cdk:build`** (see [CONTRIBUTING.md](./CONTRIBUTING.md)).
Expand Down Expand Up @@ -120,7 +121,7 @@ To build or test only the CLI subproject:

## Boundaries

- **Generated docs** — If you change docs sources (`docs/guides/`, `docs/design/`, `CONTRIBUTING.md`), run `mise //docs:sync` or `mise //docs:build`.
- **Generated docs (CI will reject if stale)** — Editing files in `docs/guides/`, `docs/design/`, or `CONTRIBUTING.md` requires regenerating Starlight mirrors under `docs/src/content/docs/`. Run **`cd docs && node scripts/sync-starlight.mjs`** (fast, <1 s) or **`mise //docs:sync`**, then commit the updated mirrors alongside your source changes. The pre-commit hook `docs-sync` does this automatically when prek hooks are installed, but if you bypass hooks (e.g. `--no-verify`), CI's "Fail build on mutation" step will catch it.
- **Dependencies** — Add dependencies to the owning package `package.json` (`cdk/`, `cli/`, or `docs/`), then install via workspace/root install.
- **Build before commit** — Run a full build (`mise run build`) when done so tests/synth/docs/security checks stay in sync.
- **Build before commit** — Run a full build (`mise run build`) when done so tests/synth/docs/security checks stay in sync. This is especially critical for docs changes — the build includes `//docs:sync` which regenerates Starlight mirrors, and CI will fail if the committed mirrors don't match what the build produces.
- **Major changes** — Before modifying existing files in a major way (large refactors, new stacks, changing the agent contract), ask first.
2 changes: 2 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
@AGENTS.md

See also [README.md](./README.md) for the Claude Code plugin (`docs/abca-plugin/`), which provides interactive guided workflows for setup, deployment, repository onboarding, task submission, and troubleshooting via `/setup`, `/deploy`, `/onboard-repo`, `/submit-task`, `/status`, and `/troubleshoot` skills. Run Claude Code with `claude --plugin-dir docs/abca-plugin` to activate it.
13 changes: 13 additions & 0 deletions docs/abca-plugin/skills/deploy/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,16 @@ After a successful deploy, remind the user to:
- Store/update the GitHub PAT in Secrets Manager if this is a fresh deployment
- Onboard repositories via Blueprint constructs if needed
- Run a smoke test: `curl -s -H "Authorization: $TOKEN" $API_URL/tasks`

## Least-Privilege Deployment

By default, CDK bootstrap grants `AdministratorAccess` to the CloudFormation execution role. For production or security-sensitive accounts, re-bootstrap with a scoped execution policy:

```bash
cdk bootstrap aws://ACCOUNT/REGION \
--cloudformation-execution-policies "arn:aws:iam::ACCOUNT:policy/IaCRole-ABCA-Infrastructure" \
--cloudformation-execution-policies "arn:aws:iam::ACCOUNT:policy/IaCRole-ABCA-Application" \
--cloudformation-execution-policies "arn:aws:iam::ACCOUNT:policy/IaCRole-ABCA-Observability"
```

See `docs/design/DEPLOYMENT_ROLES.md` in the repo root for the complete least-privilege IAM policies, trust policy, runtime role inventory, and iterative tightening recommendations.
8 changes: 7 additions & 1 deletion docs/abca-plugin/skills/setup/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,17 @@ If `mise run install` fails with "yarn: command not found", Corepack wasn't acti

## Phase 3: One-Time AWS Setup

On a fresh AWS account, X-Ray needs a CloudWatch Logs resource policy before it can write spans. Run both commands — the first creates the policy, the second sets the destination:

```bash
ACCOUNT_ID=$(aws sts get-caller-identity --query Account --output text)
aws logs put-resource-policy \
--policy-name xray-spans-policy \
--policy-document "{\"Version\":\"2012-10-17\",\"Statement\":[{\"Sid\":\"XRaySpansAccess\",\"Effect\":\"Allow\",\"Principal\":{\"Service\":\"xray.amazonaws.com\"},\"Action\":[\"logs:PutLogEvents\",\"logs:CreateLogGroup\",\"logs:CreateLogStream\"],\"Resource\":[\"arn:aws:logs:*:${ACCOUNT_ID}:log-group:aws/spans\",\"arn:aws:logs:*:${ACCOUNT_ID}:log-group:aws/spans:*\"]}]}"
aws xray update-trace-segment-destination --destination CloudWatchLogs
```

This must be run once per AWS account before first deployment.
These must be run once per AWS account before first deployment. If the `put-resource-policy` step is skipped, the `update-trace-segment-destination` command fails with `AccessDeniedException`.

## Phase 4: First Deployment

Expand Down
5 changes: 4 additions & 1 deletion docs/astro.config.mjs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 16 additions & 11 deletions docs/design/COST_MODEL.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,16 @@ These costs are incurred regardless of task volume:
| Component | Estimated cost | Notes |
|---|---|---|
| NAT Gateway (1×) | ~$32/month | Fixed hourly cost + data processing. Single AZ (see [COMPUTE.md - Network architecture](./COMPUTE.md)). |
| VPC Interface Endpoints (7×) | ~$50/month | $0.01/hr per endpoint per AZ. |
| VPC Interface Endpoints (7×, 2 AZs) | ~$102/month | $0.01/hr × 7 endpoints × 2 AZs × 730 hrs. |
| VPC Flow Logs | ~$3/month | CloudWatch ingestion. |
| DynamoDB (on-demand, idle) | ~$0/month | Pay-per-request; no cost when idle. |
| CloudWatch Logs retention | ~$1–5/month | Depends on log volume. 90-day retention. |
| API Gateway (idle) | ~$0/month | Pay-per-request. |
| **Total baseline** | **~$85–90/month** | |
| **Total baseline** | **~$140–150/month** | |

### Scale-to-zero characteristics

Most platform components are fully serverless and incur zero cost when idle: DynamoDB (PAY_PER_REQUEST), Lambda, API Gateway, ECS Fargate (cluster is free, when enabled), AgentCore Runtime (per-session), Bedrock (per-token), and Cognito (free tier). The always-on cost floor (~$140–150/month) is dominated by VPC networking infrastructure (NAT Gateway + 7 interface endpoints across 2 AZs) which is required for private subnet connectivity to AWS services and GitHub. See the [Deployment guide](../guides/DEPLOYMENT_GUIDE.md) for the full scale-to-zero breakdown.

## Per-task variable costs

Expand All @@ -43,16 +47,16 @@ Assuming a typical task: 1–2 hours, Claude Sonnet, ~100K input tokens, ~20K ou
| Model choice | 5–10× between Haiku and Opus | Default to Claude Sonnet; allow per-repo override. |
| Turn count | Linear with turns | `max_turns` cap (default 100, configurable 1–500). |
| Cost budget | Hard stop at budget | `max_budget_usd` cap (configurable $0.01–$100). Agent stops when budget is reached regardless of remaining turns. |
| Task duration | Sub-linear (compute is cheap; tokens dominate) | 8-hour max session timeout. |
| Task duration | Sub-linear (compute is cheap; tokens dominate) | AgentCore: 8-hour service limit; orchestrator: 9-hour `executionTimeout`. |
| Prompt caching | 50–90% token cost reduction | Enable by default; cache system prompts and repo context. |
| Concurrency | Linear with parallel tasks | Per-user and system-wide concurrency limits. |

## Cost at scale

| Scale | Tasks/month | Estimated monthly cost (infra + tasks) |
|---|---|---|
| Low (1 developer) | 30–60 | $150–500 |
| Medium (small team) | 200–500 | $500–3,000 |
| Low (1 developer) | 30–60 | $200–550 |
| Medium (small team) | 200–500 | $550–3,000 |
| High (org-wide) | 2,000–5,000 | $5,000–30,000 |

These estimates assume Claude Sonnet with prompt caching enabled and average task complexity.
Expand All @@ -72,8 +76,8 @@ For multi-user deployments, cost should be attributable to individual users and
|---|---|---|
| Turn limit | `max_turns` per task | 100 |
| Cost budget | `max_budget_usd` per task | None (unlimited) |
| Session timeout | Orchestrator timeout | 8 hours |
| Concurrency limit | Per-user atomic counter | 2 concurrent tasks |
| Session timeout | Orchestrator timeout | 9 hours |
| Concurrency limit | Per-user atomic counter | 3 concurrent tasks |
| System concurrency | System-wide counter | Account-level AgentCore quota |

## Additional guardrails
Expand All @@ -85,7 +89,8 @@ For multi-user deployments, cost should be attributable to individual users and

## Reference

- [COMPUTE.md - Network architecture](./COMPUTE.md) - VPC infrastructure cost breakdown.
- [ORCHESTRATOR.md](./ORCHESTRATOR.md) - Polling cost analysis.
- [COMPUTE.md](./COMPUTE.md) - Compute option billing models.
- [OBSERVABILITY.md](./OBSERVABILITY.md) - Cost-related metrics (`agent.cost_usd`, token usage).
- [COMPUTE.md](./COMPUTE.md) -- Compute option billing models and network architecture.
- [ORCHESTRATOR.md](./ORCHESTRATOR.md) -- Polling cost analysis.
- [OBSERVABILITY.md](./OBSERVABILITY.md) -- Cost-related metrics (`agent.cost_usd`, token usage).
- [Deployment guide](../guides/DEPLOYMENT_GUIDE.md) -- Deployment choices, scale-to-zero analysis, AWS services inventory.
- [DEPLOYMENT_ROLES.md](./DEPLOYMENT_ROLES.md) -- Least-privilege IAM policies for deployment.
Loading
Loading