Skip to content

feat(blueprint): add tool profiles for dynamic per-task tool selection#82

Open
tycenjmccann wants to merge 1 commit into
aws-samples:mainfrom
tycenjmccann:feat/dynamic-tool-profiles
Open

feat(blueprint): add tool profiles for dynamic per-task tool selection#82
tycenjmccann wants to merge 1 commit into
aws-samples:mainfrom
tycenjmccann:feat/dynamic-tool-profiles

Conversation

@tycenjmccann
Copy link
Copy Markdown

Summary

  • Introduces named Tool Profiles — deploy-time configurations that define which MCP servers, skills, and Cedar policies are available to the agent on a per-task basis
  • Adds toolProfiles prop to the Blueprint CDK construct, stored as JSON in the RepoConfig DynamoDB table
  • Adds tool_profile field to CreateTaskRequest / TaskRecord / TaskDetail with format validation and profile existence checking at task admission
  • Adds --tool-profile CLI flag to bgagent submit
  • Adds tool_profile to the agent's TaskConfig model (ready for PR 2 to consume)

This is PR 1 of 2: schema, validation, and CLI only. PR 2 will add context hydration resolution and agent runtime activation.

Motivation

The platform currently uses a single capabilityTier (default/extended) set at deploy time per repo. This PR enables per-task tool selection from a pre-approved catalog of profiles, so different task scopes (frontend, backend, infra) can activate different MCP servers and skills without changing the security model.

Key design decisions:

  • Profiles are deploy-time artifacts (same trust level as existing cedarPolicies) — only the profile name is user-controlled at runtime
  • Backward compatible — repos without toolProfiles continue working exactly as before
  • Phase 3 trust model preserved — no runtime policy injection

Files changed (15 files, +571 lines)

Package Files Purpose
cdk/src/ blueprint.ts, types.ts, validation.ts, repo-config.ts, create-task-core.ts Schema, storage, validation
cdk/test/ 4 test files 362 lines of new tests
cli/src/ types.ts, commands/submit.ts CLI types + --tool-profile flag
agent/ models.py, config.py, 2 test files Agent-side contract

Test plan

  • CDK TypeScript compiles (tsc --noEmit)
  • CLI TypeScript compiles (tsc --noEmit)
  • CDK synth produces valid CloudFormation template
  • Full CDK test suite passes (68/68 suites, 1197 tests)
  • Agent Python tests pass (61 tests)
  • New tests cover: profile name validation, DDB serialization, admission rejection for invalid/nonexistent profiles, backward compat (omitted profile)
  • Reviewer: confirm Phase 3 trust model compatibility (profiles are deploy-time only, same as existing cedarPolicies)

🤖 Generated with Claude Code

…election

Introduces named Tool Profiles — deploy-time configurations that define
which MCP servers, skills, and Cedar policies are available to the agent
on a per-task basis. This is PR 1 of 2: schema, validation, and CLI flag
only (no runtime resolution yet).

- Add ToolProfile interface and toolProfiles prop to Blueprint construct
- Store profiles as JSON in RepoConfig DynamoDB table
- Add tool_profile field to CreateTaskRequest, TaskRecord, TaskDetail
- Validate profile name format (lowercase alphanumeric + hyphens, 1-64 chars)
- Validate profile exists in repo's Blueprint at task admission
- Add --tool-profile flag to CLI submit command
- Add tool_profile field to agent TaskConfig model
- Mirror types across CDK ↔ CLI sync boundary

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant