Skip to content

Commit 6dd0021

Browse files
committed
feat: add autonomous agent capabilities with adversarial testing and release digest orchestration
- Add adversarial tester SOP for breaking code with evidence-based testing - Add release digest orchestrator SOP for weekly coordinated analysis - Add orchestrator module with security limits for agent-to-agent dispatch - Add template workflows for autonomous execution and control loop - Update input parser to support new agent types (adversarial-test, release-digest) - Update agent runner to integrate orchestrator tools - Update README with comprehensive documentation Security controls: - Max concurrent sub-agents (default: 3) - Max total agents per run (default: 5) - Per-agent timeout (default: 30min) - Cooldown between dispatches (default: 10s) - Rate limit checking before dispatch - Self-trigger prevention for agent accounts Resolves: agent-of-mkmeral/strands-coder#33
1 parent 7ef4c43 commit 6dd0021

8 files changed

Lines changed: 1764 additions & 6 deletions

File tree

strands-command/README.md

Lines changed: 172 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -477,3 +477,175 @@ Use workflow dispatch with:
477477
---
478478

479479
**Note**: This system is designed for trusted environments. Always review security implications before deployment and implement appropriate guardrails for your use case.
480+
481+
## Autonomous Agent Capabilities
482+
483+
### Overview
484+
485+
In addition to the `/strands` command interface, strands-command supports autonomous agent execution via scheduled workflows. This enables:
486+
487+
- **Weekly release digests** with adversarial testing, release notes, and docs gap analysis
488+
- **Agent orchestration** — agents dispatching sub-agents for parallel work
489+
- **Scheduled automation** via a control loop pattern
490+
491+
### New Agent Types
492+
493+
#### Adversarial Tester (`task-adversarial-tester.sop.md`)
494+
495+
Breaks code changes by finding bugs, edge cases, security holes, and failure modes with concrete evidence.
496+
497+
**Workflow**: Setup → Attack Surface Analysis → Test Generation → Execute → Report
498+
499+
**Capabilities:**
500+
- Edge case and boundary testing
501+
- Failure mode and error handling testing
502+
- Contract verification against PR claims
503+
- Security probing (injection, path traversal, credential leaks)
504+
- Concurrency and race condition testing
505+
- Produces runnable failing test artifacts as evidence
506+
507+
**Trigger**:
508+
- `/strands adversarial-test` on a PR
509+
- Automated dispatch from release digest orchestrator
510+
511+
#### Release Digest Orchestrator (`task-release-digest.sop.md`)
512+
513+
Produces comprehensive weekly release digests by coordinating multiple parallel analysis agents.
514+
515+
**Workflow**: Discover Changes → Plan Tasks → Dispatch Sub-Agents → Collect Results → Synthesize → Publish
516+
517+
**Capabilities:**
518+
- Finds all changes since last release tag
519+
- Dispatches adversarial testing, release notes, and docs gap sub-agents in parallel
520+
- Collects and synthesizes results from all sub-agents
521+
- Creates consolidated digest issue with findings, draft notes, and action items
522+
- Graceful degradation when sub-agents fail
523+
524+
**Trigger**:
525+
- Scheduled weekly (Wednesday 10am UTC default)
526+
- `/strands release-digest` on an Issue
527+
- `workflow_dispatch` with `release-digest` command
528+
529+
### Agent Orchestration
530+
531+
The orchestrator module (`orchestrator.py`) enables agents to dispatch and coordinate sub-agents with built-in security limits.
532+
533+
#### Security Controls
534+
535+
| Control | Default | Environment Variable |
536+
|---------|---------|---------------------|
537+
| Max concurrent agents | 3 | `ORCHESTRATOR_MAX_CONCURRENT` |
538+
| Max total agents per run | 5 | `ORCHESTRATOR_MAX_TOTAL_AGENTS` |
539+
| Per-agent timeout | 30 min | `ORCHESTRATOR_AGENT_TIMEOUT_MINUTES` |
540+
| Token budget per agent | 32000 | `ORCHESTRATOR_AGENT_MAX_TOKENS` |
541+
| Cooldown between dispatches | 10s | `ORCHESTRATOR_COOLDOWN_SECONDS` |
542+
543+
#### Architecture
544+
545+
```mermaid
546+
graph TD
547+
A[Control Loop] -->|hourly check| B[Schedule Check]
548+
B -->|Wednesday 10am| C[Release Digest Agent]
549+
C -->|dispatch| D[Adversarial Tester]
550+
C -->|dispatch| E[Release Notes Generator]
551+
C -->|dispatch| F[Docs Gap Analyzer]
552+
D -->|results| C
553+
E -->|results| C
554+
F -->|results| C
555+
C -->|create| G[Digest Issue]
556+
557+
style C fill:#f9f,stroke:#333,stroke-width:2px
558+
style G fill:#9f9,stroke:#333,stroke-width:2px
559+
```
560+
561+
#### Self-Trigger Prevention
562+
563+
The orchestrator uses the same pattern as strands-coder to prevent infinite loops:
564+
- Agent accounts can only trigger workflows via explicit `workflow_dispatch`
565+
- Comments and other events from agent accounts are ignored
566+
- Each dispatch requires PAT_TOKEN authentication
567+
- Rate limiting prevents runaway dispatches
568+
569+
### Setting Up Autonomous Agents
570+
571+
#### 1. Copy Workflow Templates
572+
573+
Copy the template workflows to your repository:
574+
575+
```bash
576+
# From the devtools/strands-command/workflows/ directory
577+
cp strands-autonomous.yml your-repo/.github/workflows/
578+
cp strands-control.yml your-repo/.github/workflows/
579+
```
580+
581+
#### 2. Configure Repository Variables
582+
583+
Set the `AGENT_SCHEDULES` repository variable:
584+
585+
```json
586+
{
587+
"jobs": {
588+
"weekly_release_digest": {
589+
"enabled": true,
590+
"cron": "0 10 * * 3",
591+
"command": "release-digest",
592+
"workflow": "strands-autonomous.yml",
593+
"last_triggered": 0
594+
}
595+
}
596+
}
597+
```
598+
599+
#### 3. Configure Secrets
600+
601+
In addition to the standard secrets (`AWS_ROLE_ARN`, `AWS_SECRETS_MANAGER_SECRET_ID`), add:
602+
603+
| Secret | Description |
604+
|--------|-------------|
605+
| `PAT_TOKEN` | Personal access token with `workflow_dispatch` permission (required for sub-agent dispatch) |
606+
607+
#### 4. Optional: Configure Security Limits
608+
609+
Set repository variables to adjust orchestrator limits:
610+
611+
| Variable | Default | Description |
612+
|----------|---------|-------------|
613+
| `ORCHESTRATOR_MAX_CONCURRENT` | `3` | Max sub-agents running simultaneously |
614+
| `ORCHESTRATOR_AGENT_TIMEOUT_MINUTES` | `30` | Per-agent timeout |
615+
| `ORCHESTRATOR_MAX_TOTAL_AGENTS` | `5` | Max total sub-agents per orchestration run |
616+
617+
### Usage Examples
618+
619+
#### Manual Adversarial Testing
620+
621+
Comment on a PR:
622+
```
623+
/strands adversarial-test Focus on the new authentication flow edge cases
624+
```
625+
626+
#### Manual Release Digest
627+
628+
Comment on an issue:
629+
```
630+
/strands release-digest Generate digest for changes since v1.5.0
631+
```
632+
633+
#### Workflow Dispatch
634+
635+
Trigger the autonomous workflow manually:
636+
```bash
637+
gh workflow run strands-autonomous.yml \
638+
-f command="adversarial-test" \
639+
-f issue_id="123"
640+
```
641+
642+
### Orchestrator Tools (for Agent Use)
643+
644+
When running as an orchestrator agent, these tools are available:
645+
646+
| Tool | Description |
647+
|------|------------|
648+
| `dispatch_agent` | Dispatch a sub-agent via workflow_dispatch (with security limits) |
649+
| `check_agents_status` | Check status of all dispatched sub-agents |
650+
| `wait_for_agents` | Wait for all sub-agents to complete (with timeout) |
651+
| `get_orchestrator_config` | View current orchestrator security configuration |

0 commit comments

Comments
 (0)