

This service is in preview release and is subject to change.

# Clean up AWS Greenlight for Agents

To remove AWS Greenlight for Agents and the resources that it created, complete the following steps.

1. To remove AWS Greenlight policies from your gateway or box, ask AWS Greenlight to remove them, for example `remove my policies from the gateway`. This also removes the `pbmc_` policies that let your agent’s model calls through. If the engine still enforces afterward, AWS Greenlight warns you which calls will start being denied before it removes anything. (`roll back` undoes only the last change.)

1. For a gateway, delete its dashboard. It’s in the gateway’s Region. To find its name, run the following AWS CLI command.

   ```bash
   aws cloudwatch list-dashboards --dashboard-name-prefix PolicyBuilder- --region us-east-1 --profile your-profile
   ```

   Then delete the one named for your gateway. Leave any dashboard named `PolicyBuilder-stack-…​`, which belongs to a CloudFormation stack.

   ```bash
   aws cloudwatch delete-dashboards --dashboard-names PolicyBuilder-your-gateway-id --region us-east-1 --profile your-profile
   ```

1. If you ran the network check, delete its Network Access Analyzer queries. In the console and the AWS CLI, they’re Network Access Scopes, tagged `PolicyBuilderTarget` (your Runtime’s ID) and `PolicyBuilderScope` (`ingress` or `egress`). To find them, run the following command.

   ```bash
   aws ec2 describe-network-insights-access-scopes --filters Name=tag-key,Values=PolicyBuilderTarget --region us-east-1 --profile your-profile
   ```

   Delete each scope with `aws ec2 delete-network-insights-access-scope`. If AWS says the scope still has analyses, delete them first with `aws ec2 delete-network-insights-access-scope-analysis`.

1. Delete the test results.

   ```bash
   aws s3 rm s3://your-bucket-name/greenlight/ --recursive --profile your-profile
   ```

   If the bucket was only for AWS Greenlight, delete the bucket instead. The bucket that AWS Greenlight creates has versioning turned on, so empty it and delete it in the Amazon S3 console, or delete every object version before you delete the bucket.

1. Remove AWS Greenlight from each coding agent that has it.

   In Kiro:

   ```bash
   kiro-cli powers uninstall greenlight-for-agents
   ```

   In Claude Code:

   ```bash
   claude plugin uninstall greenlight-for-agents@aws-greenlight
   claude plugin marketplace remove aws-greenlight
   ```

   In Codex:

   ```bash
   codex plugin remove greenlight-for-agents@aws-greenlight
   codex plugin marketplace remove aws-greenlight
   ```

1. Delete AWS Greenlight’s Python environments. Do this before the next step, while the toolkit that finds uv is still there. It deletes nothing if it can’t find uv.

   ```bash
   c="$(sh ~/aws-greenlight-for-agents/plugins/greenlight-for-agents/skills/agent-policies/scripts/tool uv cache dir)" && [ -n "$c" ] && rm -rf "$c/greenlight-for-agents"
   ```

1. Delete AWS Greenlight’s files. This removes the toolkit, the Dogwood CLI in `~/policy-builder-deps`, and the installer’s `~/.local/bin/dogwood` link.

   ```bash
   rm -rf ~/aws-greenlight-for-agents ~/policy-builder-deps ~/.local/bin/dogwood
   ```

   If you added the `PATH` line that the installer printed, you can delete it from your shell’s startup file, such as `~/.zshrc`. An older installer added the line for you, under `# added by Policy Builder install.sh`. uv and the AWS CLI stay installed, and so does Rust if you installed it for the Dogwood CLI.

1. The project’s `.greenlight` folder holds copies of your agent’s tool calls. Delete the folder, or check what’s in it before you share it or add it to source control.