Skip to content

feat: add AWS sandbox provider#11

Draft
tonycoder-hub wants to merge 9 commits into
Boulea7:mainfrom
tonycoder-hub:feat/aws-sandbox-provider
Draft

feat: add AWS sandbox provider#11
tonycoder-hub wants to merge 9 commits into
Boulea7:mainfrom
tonycoder-hub:feat/aws-sandbox-provider

Conversation

@tonycoder-hub

@tonycoder-hub tonycoder-hub commented Jul 12, 2026

Copy link
Copy Markdown

Summary

  • add a built-in public AWS sandbox provider behind the provider-neutral lifecycle contract from feat: add configurable sandbox provider launcher #10
  • map android-real to AWS Device Farm Remote Access and expose only a loopback WebDriver/Appium relay
  • map pc-vm to an EC2 Windows Launch Template and expose only a loopback SSM RDP tunnel
  • enforce resource TTL with a same-account EventBridge Scheduler one-time action
  • reconcile ambiguous EC2 creates with the idempotency token plus exact ownership/expiry tags
  • keep credentials, signed endpoints, Session Manager data, and Windows passwords out of state and output

This is stacked on #10. Until #10 merges, this PR also contains its provider-contract commits.

Safety

Every successful start must create the AWS-side expiry schedule. Tagging, schedule, or state failures trigger compensation cleanup and surface any cleanup failure with the recoverable resource ID. Manual destructive actions re-check the caller account and exact remote ownership tags.

The AWS CLI child does not inherit static access-key/session-token values or raw container authorization tokens. Shared/SSO profiles, IMDS, web identity, and validated ECS/EKS credential references remain supported.

Verification

  • 630 passed
  • ruff check .
  • git diff --check
  • AWS CLI v2 skeleton checks for the Device Farm tag wire format and EventBridge Scheduler command shape
  • independent GPT, Orange, and Seed review: aggregate PASS_WITH_NOTES

No real AWS account, Device Farm project/device, EC2 Launch Template, or Scheduler role was available, so no paid cloud resource was created and real AWS E2E is not verified.

Draft Exit Criteria

  • run Device Farm start/status/attach/stop against an operator-owned project/device
  • run EC2 Windows start/status/SSM attach/stop against an operator-owned Launch Template
  • confirm the Scheduler universal targets execute in the target account
  • decide whether the documented create-to-schedule crash window requires an account-side expiry-tag janitor before merge

The 600-second minimum TTL reflects Scheduler's minute-level precision. A failed expiry action can retry for up to 24 hours.


Summary by cubic

Adds a provider‑neutral sandbox lifecycle with built‑in aws and local providers. You can now launch Android real devices via AWS Device Farm and Windows desktop VMs via EC2+SSM, with TTL‑enforced cleanup and no secrets in state.

  • New Features

    • New MCP tools: agy_sandbox_start, agy_sandbox_status, agy_sandbox_stop, agy_sandbox_logs, agy_sandbox_attach.
    • Built-in aws provider: maps android-real to Device Farm (WebDriver/Appium loopback relay) and pc-vm to EC2 Windows via SSM RDP tunnel; enforces expiry via EventBridge Scheduler (min TTL 600s) and reconciles ambiguous EC2 creates with idempotency tokens.
    • Built-in local provider: starts Playwright run-server, Android Emulator/adb, and optional Appium for quick local testing.
    • New CLIs: agy-local-sandbox, agy-aws-sandbox. Server now exposes 16 tools total.
    • Docs expanded (architecture, examples, install, security). Test suite now shows 630 passed.
  • Security

    • AWS child processes do not inherit static AWS_* credentials; outputs are redacted and sensitive data (signed endpoints, SSM data, Windows passwords) are not stored or returned.
    • Exact ownership and expiry tags are enforced; scheduling/tag/state failures fail closed with compensation cleanup.
    • Provider commands run without a shell; inputs are bounded and logs are size‑limited before returning.

Written for commit b28603a. Summary will update on new commits.

Review in cubic

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @tonycoder-hub, your pull request is larger than the review limit of 150000 diff characters

@coderabbitai

coderabbitai Bot commented Jul 12, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 18bd80f7-8778-4e51-a805-dc4846d73671

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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