Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
100 commits
Select commit Hold shift + click to select a range
d4ef8bf
interrupt - docstring - fix formatting (#1074)
pgrayy Oct 24, 2025
1544384
ci: add pr size labeler (#1082)
dbschmigelski Oct 24, 2025
999e654
fix: Don't bail out if there are no tool_uses (#1087)
zastrowm Oct 24, 2025
3446938
feat(mcp): add experimental agent managed connection via ToolProvider…
dbschmigelski Oct 27, 2025
73865d3
fix (bug): retry on varying Bedrock throttlingexception cases (#1096)
mehtarac Oct 27, 2025
2147920
feat: skip model invocation when latest message contains ToolUse (#1068)
Unshure Oct 27, 2025
071f89f
direct tool call - interrupt not allowed (#1097)
pgrayy Oct 27, 2025
49e432d
mcp elicitation (#1094)
pgrayy Oct 28, 2025
104ecb5
fix(litellm): enhance structured output handling (#1021)
Arindam200 Oct 28, 2025
c2ba0f7
Transform invalid tool usages on sending, not on initial detection (#…
zastrowm Oct 28, 2025
4e49d9a
fix: (bug): Drop reasoningContent from request (#1099)
mehtarac Oct 29, 2025
c302a8a
fix: Dont initialize an agent on swarm init (#1107)
Unshure Oct 29, 2025
95906fa
feat: add multiagent session/repository management. (#1071)
JackYPCOnline Oct 29, 2025
111e77c
feat(multiagent): Add stream_async (#961)
mkmeral Oct 31, 2025
ce5c662
fix: properly redact toolResult blocks (#1080)
leotac Oct 31, 2025
3b00110
linting (#1120)
pgrayy Oct 31, 2025
db671ba
Fix input/output message not redacted when guardrails_trace="enabled_…
leotac Oct 31, 2025
bed1b68
fix: Allow none structured output context in tool executors (#1128)
mkmeral Nov 3, 2025
417ebea
fix: Fix broken converstaion with orphaned toolUse (#1123)
Unshure Nov 3, 2025
5981d36
feat: Enable multiagent session persistent in Graph/Swarm (#1110)
JackYPCOnline Nov 4, 2025
9f10595
feat(models): add SystemContentBlock support for provider-agnostic ca…
dbschmigelski Nov 4, 2025
89bab98
fix(models/gemini): handle non-JSON error messages from Gemini API (#…
Ratish1 Nov 4, 2025
e844b30
fix: Handle "prompt is too long" from Anthropic (#1137)
zastrowm Nov 5, 2025
1df45be
feat(telemetry): Add tool definitions to traces via semconv opt-in (#…
Ratish1 Nov 6, 2025
28fea41
fix: Strip argument sections out of inputSpec top-level description (…
zastrowm Nov 7, 2025
c250fc0
share thread context (#1146)
pgrayy Nov 7, 2025
2b0c6e6
async hooks (#1119)
pgrayy Nov 7, 2025
3061116
feat(tools): Support string descriptions in Annotated parameters (#1089)
Ratish1 Nov 10, 2025
e930243
chore(telemetry): updated opt-in attributes to internal (#1152)
poshinchen Nov 11, 2025
bbe765d
feat(models): allow SystemContentBlocks in LiteLLMModel (#1141)
dbschmigelski Nov 11, 2025
ccc3a8b
share interrupt state (#1148)
pgrayy Nov 11, 2025
57e2081
fix: Don't hang when MCP server returns 5xx (#1169)
zastrowm Nov 12, 2025
8cae18c
fix(models): allow setter on system_prompt and system_prompt_content …
dbschmigelski Nov 12, 2025
cee5145
feat: allow setting a timeout when creating MCPAgentTool (#1184)
AnirudhKonduru Nov 14, 2025
ded0934
fix(litellm): add validation for stream parameter in LiteLLM (#1183)
dbschmigelski Nov 17, 2025
77cb23f
fix(event_loop): handle MetadataEvents without optional usage and met…
dbschmigelski Nov 17, 2025
b4efc9d
swarm - switch to handoff node only after current node stops (#1147)
pgrayy Nov 17, 2025
95ac650
fix(a2a): base64 decode byte data before placing in ContentBlocks (#1…
dbschmigelski Nov 18, 2025
ab5f8ee
multi agent input (#1196)
pgrayy Nov 19, 2025
432d269
interrupt - activate - set context separately (#1194)
pgrayy Nov 19, 2025
fb8a861
feat(callback_handler): optional verbose output for PrintingCallbackH…
marcbrooker Nov 20, 2025
f554cca
fix: fix swarm session management integ test. (#1155)
JackYPCOnline Nov 20, 2025
a4837d4
move tool caller definition out of agent module (#1215)
pgrayy Nov 20, 2025
93997f0
interrupt - interruptible multi agent hook interface (#1207)
pgrayy Nov 20, 2025
87e0f34
security(tool_loader): prevent tool name and sys modules collisions i…
dbschmigelski Nov 21, 2025
efeba7b
fix(mcp): protect connection on non-fatal client side timeout error (…
dbschmigelski Nov 21, 2025
3efc9c0
fix(litellm): populate cacheWriteInputTokens from cache_creation_inpu…
dbschmigelski Nov 21, 2025
eaa6efb
fix: fix integ test for mcp eclicitation_server (#1234)
JackYPCOnline Nov 21, 2025
aaf9715
fix(tools): avoid KeyError in direct tool calls with ToolContext (#1213)
qmays-phdata Nov 24, 2025
8e6f48a
fix: attached custom attributes to all spans (#1235)
poshinchen Nov 25, 2025
f3cee8c
hooks - before node call - cancel node (#1203)
pgrayy Nov 26, 2025
f8c3008
interrupts - support falsey responses (#1256)
pgrayy Nov 26, 2025
01b821c
Bidirectional Streaming Agent (#1276)
mehtarac Dec 3, 2025
9fa818e
mcp - elicitation - fix server request (#1281)
pgrayy Dec 3, 2025
50969a4
feat(steering): add experimental steering for modular prompting (#1280)
dbschmigelski Dec 3, 2025
62534de
test(steering): adjust integ test system prompts to reduce flakiness …
dbschmigelski Dec 3, 2025
5ea97f9
Remove toolUse message when its missing due to pagination in session …
afarntrog Dec 4, 2025
25f1ce6
interrupts - swarm (#1193)
pgrayy Dec 5, 2025
911a1c7
fix(agent): Return structured output JSON when AgentResult has no tex…
afarntrog Dec 5, 2025
d1b523c
bidi - fix record direct tool call (#1300)
pgrayy Dec 5, 2025
2944abf
Update doc strings for the doc build (#1284)
zastrowm Dec 6, 2025
45dd597
fix: fix broken tool spec with composition keywords (#1301)
mkmeral Dec 8, 2025
6543097
bidi - tests - lint (#1307)
pgrayy Dec 9, 2025
e692133
bidi - fix mypy errors (#1308)
pgrayy Dec 9, 2025
9f70298
feat(hooks): add AgentResult to AfterInvocationEvent (#1125)
Ratish1 Dec 10, 2025
a64a851
feat(docs): Create agent.md and docs folder (#1312)
mkmeral Dec 10, 2025
60bd291
bidi - remove python 3.11+ features (#1302)
pgrayy Dec 11, 2025
2a02388
fix(mcp): close mcp client event loop (#1321)
davidpadbury Dec 15, 2025
d6284a6
Add issue-responder action (#1319)
afarntrog Dec 16, 2025
6737897
feat(a2a): support passing additional keyword arguments to FastAPI an…
snooyen Dec 17, 2025
bb46ab7
feat(tools): add replace method to ToolRegistry (#1182)
Ratish1 Dec 17, 2025
bd17e95
feat(mcp): add meta field support to MCP tool results (#1237)
vamgan Dec 17, 2025
583b10e
style: remove redundant None from dict.get() calls (#956)
Ratish1 Dec 18, 2025
82f5bcf
chore: Expose Status from .base for easier imports (#1356)
zastrowm Dec 18, 2025
1792ddb
fix(bedrock): CitationLocation is UnionType, and correctly joining ci…
ericfzhu Dec 18, 2025
4342fda
fix(telemetry): prevent double counting of usage metrics (#1327)
rajib76 Dec 18, 2025
3d03a35
feat: add support for web and search result citations (#1344)
danilop Dec 19, 2025
3cb39a6
feat: add gemini_tools field to GeminiModel with validation and tests…
pshiko Dec 19, 2025
894ba80
Port PR guidelines from sdk-typescript (#1373)
zastrowm Dec 19, 2025
0c640e8
feat: allow custom-client for OpenAIModel and GeminiModel (#1366)
poshinchen Dec 21, 2025
1907a16
fix: Pass CODECOV_TOKENS through for code-coverage stats (#1385)
zastrowm Dec 22, 2025
138f5ab
ci: bump actions/checkout from 5 to 6 (#1222)
dependabot[bot] Dec 22, 2025
20ae18c
ci: update pytest-asyncio requirement (#1166)
dependabot[bot] Dec 22, 2025
87caf1c
ci: bump actions/upload-artifact from 4 to 6 (#1332)
dependabot[bot] Dec 23, 2025
2c0aab0
ci: bump actions/download-artifact from 5 to 7 (#1333)
dependabot[bot] Dec 23, 2025
c1c24ef
ci: update pre-commit requirement from <4.4.0,>=3.2.0 to >=3.2.0,<4.6…
dependabot[bot] Dec 23, 2025
ad2f201
feat: add api check to github workflow (#1348)
JackYPCOnline Dec 23, 2025
b2cc4c2
ci: bump aws-actions/configure-aws-credentials from 4 to 5 (#1352)
dependabot[bot] Dec 23, 2025
033574b
ci: update ruff requirement from <0.14.0,>=0.13.0 to >=0.13.0,<0.15.0…
dependabot[bot] Dec 23, 2025
bf1b7aa
feat: add per_turn parameter to SlidingWindowConversationManager (#1374)
zastrowm Dec 26, 2025
c73e9e5
fix: check api breaking change against main (#1397)
JackYPCOnline Dec 29, 2025
3b424d0
ci: bump astral-sh/setup-uv from 6 to 7 (#1390)
dependabot[bot] Dec 29, 2025
067d259
fix(openai): support tools returning image content (#1079)
Ratish1 Dec 29, 2025
e4f27c6
feat: added agent_invocations (#1387)
poshinchen Dec 30, 2025
e980d98
ci: bump actions/checkout from 5 to 6 (#1389)
dependabot[bot] Dec 30, 2025
c6a56ad
Re-add agents to this PR (#1403)
zastrowm Dec 30, 2025
db01eee
feat: allow hooks to retry model invocations on exceptions (#1405)
zastrowm Jan 2, 2026
b5d9468
fix: emit deprecation warning only when deprecated aliases are access…
jsamuel1 Jan 2, 2026
55484f5
docs: update github agent action to reference S3_SESSION_BUCKET
dbschmigelski Jan 5, 2026
be35316
Update README.md
dbschmigelski Jan 5, 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
11 changes: 11 additions & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
coverage:
status:
project:
default:
target: 90% # overall coverage threshold
patch:
default:
target: 90% # patch coverage threshold
base: auto
# Only post patch coverage on decreases
only_pulls: true
285 changes: 285 additions & 0 deletions .github/actions/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,285 @@
# Strands Command GitHub Actions

A comprehensive AI agent execution system for GitHub repositories that processes `/strands` commands in issues and pull requests.

## Overview

The Strands Command system enables AI-powered automation in GitHub repositories through:

- **Issue Comment Processing**: Responds to `/strands` commands in issues and PRs
- **Controlled AI Execution**: Runs AI agents with read-only and write-separated permissions
- **AWS Integration**: Secure OIDC-based authentication with Bedrock AI models
- **Security-First Design**: Manual approval gates and permission isolation

### Architecture

```mermaid
graph LR
A["strands Command"] --> B[Authorization]
B --> C[Read-Only Agent]
C --> D[Write Operations]
D --> E[Cleanup]

B -.-> B1[Permission Check]
C -.-> C1[AWS + AI Execution]
D -.-> D1[Repository Updates]
```

## Quick Start

1. **Set up AWS IAM Role** (see [IAM Role Policy](#iam-role-policy))
2. **Configure GitHub Secrets**:
- `AWS_ROLE_ARN`: Your IAM role ARN
- `STRANDS_SESSION_BUCKET`: S3 bucket for session storage
3. **Copy required files** to your repository:
- `.github/workflows/strands-command.yml`
- `.github/actions/` directory
- `.github/scripts/` directory
- `.github/agent-sops/` directory
4. **Comment `/strands [your task]`** on any issue or PR
- **On Issues**:
- Use `/strands <your task>` to have an agent help you refine an issue within the context of the current github repo
- Use `/strands implement <your task>` to create a new PR based on the description of an issue
- **On PRs**: `/strands <your task>` will instruct an Agent to review PR comments and make updates to the issue

## Actions

### strands-agent-runner

Executes AI agents with AWS integration and controlled permissions.

**Inputs:**
- `ref` (required): Git reference to checkout
- `system_prompt` (required): System instructions for the agent
- `session_id` (required): Session identifier for persistence
- `task_prompt` (required): Task description for the agent
- `aws_role_arn` (required): AWS IAM role ARN for authentication
- `sessions_bucket` (required): S3 bucket for session storage
- `write_permission` (required): Permission level flag for Read-only Sandbox mode (`true`/`false`)

**Features:**
- Strands Agent running with Agent SOPs specifically designed to instruct an Agent on how to develop in Github
- Python 3.13 and Node.js 20 environment setup (Node.js setup and npm install are optional and can be removed - only included for this repo's development)
- Read-only Sandbox support: Agent write actions can be deferred to the `strands-write-executor` action if you want your agent to execute with read-only github permissions

### strands-write-executor

Executes write operations from agent-generated artifacts if `strands-agent-runner` was run with `write_permissions: false`.

**Inputs:**
- `ref` (required): Target branch for changes
- `issue_id` (optional): Associated issue number

**Features:**
- Reads Agent modified repository state from artifacts, and pushes changes to pr branch
- Reads deferred write operations from artifact and executes them

## Workflows

### strands-command.yml

Main workflow that orchestrates the complete Strands command execution:

1. **Authorization Check**: Validates user permissions and applies approval gates
2. **Setup and Processing**: Parses input and prepares execution context
3. **Read-Only Execution**: Runs Agent in Read-only sandbox
4. **Write Operations**: Executes repository modifications in job isolated from agent
5. **Cleanup**: Removes temporary labels and artifacts

**Triggers:**
- Issue comments starting with `/strands`
- Manual workflow dispatch with parameters

## Agent SOPs

### Task Implementer (`task-implementer.sop.md`)

Implements features using test-driven development principles.

**Workflow**: Setup → Explore → Plan → Code → Commit → Pull Request

**Capabilities:**
- Feature implementation with TDD approach
- Comprehensive testing and documentation
- Pull request creation and iteration
- Code pattern following and best practices

### Task Refiner (`task-refiner.sop.md`)

Refines and clarifies task requirements before implementation.

**Workflow**: Read Issue → Analyze → Research → Clarify → Iterate

**Capabilities:**
- Requirement analysis and gap identification
- Clarifying question generation
- Implementation planning and preparation
- Ambiguity resolution through user interaction

## IAM Role Policy

### Required IAM Role

Create an IAM role with the following trust policy for GitHub OIDC:

```json
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"Federated": "arn:aws:iam::YOUR_ACCOUNT_ID:oidc-provider/token.actions.githubusercontent.com"
},
"Action": "sts:AssumeRoleWithWebIdentity",
"Condition": {
"StringEquals": {
"token.actions.githubusercontent.com:aud": "sts.amazonaws.com"
},
"StringLike": {
"token.actions.githubusercontent.com:sub": "repo:YOUR_ORG/YOUR_REPO:*"
}
}
}
]
}
```

### IAM Role Policy

Your IAM role must have these permissions in order to execute:

```json
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "Bedrock Access",
"Effect": "Allow",
"Action": [
"bedrock:InvokeModelWithResponseStream",
"bedrock:InvokeModel"
],
"Resource": "*"
},
{
"Effect": "Allow",
"Action": [
"s3:PutObject",
"s3:GetObject",
"s3:DeleteObject"
],
"Resource": [
"arn:aws:s3:::YOUR_STRANDS_SESSION_BUCKET/*"
]
},
{
"Effect": "Allow",
"Action": "s3:ListBucket",
"Resource": [
"arn:aws:s3:::YOUR_STRANDS_SESSION_BUCKET"
]
}
]
}
```

### Setup Steps

1. **Create OIDC Provider** (if not exists):
```bash
aws iam create-open-id-connect-provider \
--url https://token.actions.githubusercontent.com \
--thumbprint-list 6938fd4d98bab03faadb97b34396831e3780aea1 \
--client-id-list sts.amazonaws.com
```

2. **Create IAM Role** with the trust policy above
3. **Create S3 Bucket** for session storage
4. **Add GitHub Secrets**:
- `AWS_ROLE_ARN`: The created role ARN
- `AGENT_SESSIONS_BUCKET`: The S3 bucket name

## Security

### ⚠️ Important Security Considerations

**This workflow should only be used with trusted sources and should use AWS guardrails to help avoid prompt injection risks.**

### Security Features

#### Authorization Controls
- **Collaborator Verification**: Only users with write access get auto-approval
- **Manual Approval Gates**: Unknown users require manual approval via GitHub environments
- **Permission Separation**: Read and write operations isolated in separate jobs

#### AWS Security
- **OIDC Authentication**: No long-lived credentials stored in GitHub
- **Minimal Permissions**: Inline session policy limits access to required resources only
- **Temporary Credentials**: Each execution gets fresh, time-limited AWS credentials. You can further limit these by updating the `strands-agent-runner` "Configure AWS credentials" step, and set the `role-duration-seconds` value
- **Resource Scoping**: S3 access limited to specific session bucket

#### Prompt Injection Mitigation
- **Trusted Sources Only**: Implement strict user authorization
- **AWS Guardrails**: Use AWS Bedrock guardrails to filter malicious prompts
- **Input Validation**: Validate and sanitize all user inputs
- **Execution Isolation**: Separate read and write phases prevent unauthorized modifications

## Configuration

### GitHub Secrets

| Secret | Description | Example |
|--------|-------------|---------|
| `AWS_ROLE_ARN` | IAM role for AWS access | `arn:aws:iam::123456789012:role/GitHubActionsRole` |
| `STRANDS_SESSION_BUCKET` | S3 bucket for sessions | `my-strands-sessions-bucket` |

### Environment Variables

The actions use these environment variables during execution:

| Variable | Purpose | Set By |
|----------|---------|--------|
| `GITHUB_WRITE` | Permission level indicator | Action |
| `SESSION_ID` | Agent session identifier | Workflow |
| `S3_SESSION_BUCKET` | Session storage location | Input |
| `STRANDS_TOOL_CONSOLE_MODE` | Tool execution mode | Action |
| `BYPASS_TOOL_CONSENT` | Automated tool approval | Action |

## Usage Examples

### Basic Task Implementation

Comment on an issue:
```
/strands Implement a new user authentication feature with JWT tokens
```

### Task Refinement

Comment on an issue with unclear requirements:
```
/strands refine Please help clarify the requirements for this feature
```

### Manual Execution

Use workflow dispatch with:
- **issue_id**: `123`
- **command**: `Implement the requested feature`
- **session_id**: `optional-session-id`

### Advanced Usage

```
/strands implement Create a REST API endpoint for user management with the following requirements:
1. CRUD operations for users
2. JWT authentication
3. Input validation
4. Unit tests with 90% coverage
5. OpenAPI documentation
```

---

**Note**: This system is designed for trusted environments. Always review security implications before deployment and implement appropriate guardrails for your use case.
Loading
Loading