

# Quarantining workloads in AWS Agent Registry

When an auto-detected agent misbehaves, you can quarantine its workload from its registry record. AWS Agent Registry asks Amazon Bedrock AgentCore Runtime to deny new invocations of the agent runtime and stop its live sessions, and hides the record from discovery so builders can’t find the agent. A quarantine requires a `reason` of 1 to 255 characters.

When the issue is resolved, you unquarantine the record. Unquarantine requires no reason. The agent runtime accepts invocations again, and the record is discoverable again. If the record was approved before the quarantine, it stays approved and doesn’t need to be submitted and approved again.

The agent runtime doesn’t have to be in the same account as your registry. AWS Agent Registry makes the Runtime calls in the account that owns the agent runtime, through its service-linked role. For the permissions that role uses, see [AgentCore Runtime quarantine](using-service-linked-role-agent-registry.md#agent-registry-slr-permissions-runtime-quarantine).

## Requirements
<a name="registry-quarantine-requirements"></a>
+ Auto-detection must be enabled on the registry. For more information, see [Auto-detecting resources in AWS Agent Registry](registry-auto-detection.md).
+ The record must be an agent record that auto-detection created from an AgentCore Runtime. You can’t quarantine a record that you created yourself, or one created from another resource type.

## Permissions
<a name="registry-quarantine-permissions"></a>

Quarantine and unquarantine are separate IAM actions on the registry record:
+  `agent-registry:QuarantineRegisteredWorkload` 
+  `agent-registry:UnquarantineRegisteredWorkload` 

If you’re allowed an action on a record for the agent runtime, you can perform it. To control who can lift a quarantine, restrict `agent-registry:UnquarantineRegisteredWorkload` with IAM policies or service control policies. The `AgentRegistryFullAccess` managed policy includes both actions. For the full list of actions, see [IAM permissions for registries](registry-iam-permissions.md).

## Quarantine status
<a name="registry-quarantine-status"></a>

The record’s `quarantineStatus` tracks quarantine separately from its approval `status`. Both operations are asynchronous: they return `202` with the in-progress status, and you call `GetRegistryRecord` to see when the change finishes. Enforcement can take more than 5 minutes to reach all callers.


|  `quarantineStatus`  | Meaning | 
| --- | --- | 
|  `QUARANTINING`  | Quarantine requested. Runtime is denying new invocations and stopping live sessions. | 
|  `QUARANTINED`  | The agent runtime is quarantined. | 
|  `UNQUARANTINING`  | Unquarantine requested. Runtime is restoring invocations. | 
|  *(absent)*  | The record is not quarantined. It was never quarantined, or the quarantine was lifted. | 

When the record reaches `QUARANTINED`, AWS Agent Registry sends the `Registry Record Quarantine Status changed to Quarantined` event to Amazon EventBridge. No event is sent when a quarantine is lifted. For more information, see [Amazon EventBridge integration](registry-eventbridge.md).

## While a record is quarantined
<a name="registry-quarantine-while-quarantined"></a>

The following behavior is expected while a record has any `quarantineStatus`, including `QUARANTINING` and `UNQUARANTINING`:
+ The record is hidden from discovery, whatever its approval status. `SearchDiscoverableRegistryRecords`, `ListDiscoverableRegistryRecords`, `BatchGetDiscoverableRegistryRecord`, and the registry’s MCP endpoint don’t return it, so a page of results can come back with fewer records than requested. `GetRegistryRecord` and `ListRegistryRecords` still return it.
+ You can’t approve the record. Unquarantine it first.
+ You can’t delete the record. Unquarantine it first.
+ Until the quarantine or unquarantine finishes, you also can’t submit the record for approval or change its status.
+ You can still edit the record with `UpdateRegistryRecord`. The new revision can’t be approved until the record is unquarantined.
+ You can’t turn off auto-detection on the registry. AWS Agent Registry rejects the update with `Unquarantine this registry’s records before disabling auto-detection.` until you unquarantine every record that this registry quarantined. A record that only follows a quarantine another registry placed doesn’t hold auto-detection on. For the steps, see [Unquarantine this registry’s records before disabling auto-detection](registry-troubleshooting.md#registry-troubleshooting-quarantine-keeps-auto-detection).
+ The same agent runtime can have records in more than one registry. Every one of those records returns `quarantineStatus`, but only the record that placed the quarantine returns `quarantineReason`, `quarantinedBy`, and `quarantinedAt`.

## Security considerations
<a name="registry-quarantine-security"></a>
+  **Who can lift a quarantine.** A quarantine can be lifted from any registry that has an auto-detected record for the same agent runtime, not only from the registry that placed it. To keep a quarantine in place, restrict `agent-registry:UnquarantineRegisteredWorkload` with service control policies in the accounts that own those registries.
+  **What quarantine doesn’t do.** Quarantine denies new invocations and stops live sessions on the agent runtime. It doesn’t revoke the agent’s execution role or credentials, and it doesn’t undo calls that the agent already made to other services. To contain a compromised agent, also remove permissions from its execution role.
+  **The reason field.** AWS CloudTrail redacts the quarantine `reason`, and only the record that placed the quarantine returns it. Don’t include secrets or personal data in the reason.
+  **Monitoring.** Both operations are logged as AWS CloudTrail management events, and the `Registry Record Quarantine Status changed to Quarantined` event is sent to Amazon EventBridge. Use the event to alert your security team when an agent is quarantined, and the CloudTrail events to audit who quarantined or unquarantined it. For more information, see [AWS CloudTrail integration](registry-cloudtrail-integration.md) and [Amazon EventBridge integration](registry-eventbridge.md).

## Quarantine a workload
<a name="registry-quarantine-quarantine"></a>

### Console
<a name="registry-quarantine-quarantine-console"></a>

1. Open the [AWS Agent Registry console](https://console.aws.amazon.com/agent-registry/home?region=us-east-1#) and choose the registry.

1. Select the record, then choose **Manage**, **Quarantine**. You can also choose **Manage** on the record details page.

1. In the **Quarantine** dialog, enter a **Reason**. You must enter a reason, and you can use up to 255 characters.

1. Enter `confirm`, then choose **Quarantine**. **Quarantine** stays unavailable until you enter both a reason and the confirmation.

The record’s **Quarantine status** changes to **Quarantine in progress**, and then to **Quarantined** when enforcement completes.

Use **Quarantine** only on a registry that has an auto-detection configuration. The following table lists the reasons the action can be unavailable and what to do about each.


| Message the console shows | What to do | 
| --- | --- | 
| Select a record to quarantine or unquarantine. | Select a record in the records table first. | 
| A quarantine or unquarantine is in progress. | Wait for the current operation to finish. See [Quarantine status](#registry-quarantine-status). | 
| Auto-detection must be turned on for this registry to quarantine or unquarantine its agents. | Turn auto-detection on for the registry. See [Auto-detecting resources in AWS Agent Registry](registry-auto-detection.md). | 
| Quarantine is available only for agents auto-detected from AgentCore Runtime. | Choose an auto-detected agent record from an AgentCore Runtime. See [Requirements](#registry-quarantine-requirements). | 

### AWS CLI
<a name="registry-quarantine-quarantine-cli"></a>

```bash
aws agent-registry-control quarantine-registered-workload \
  --registry-id "<registryId>" \
  --record-id "<recordId>" \
  --reason "Agent is calling an unapproved external endpoint" \
  --region us-east-1
```

### AWS SDK
<a name="registry-quarantine-quarantine-sdk"></a>

```python
import boto3

client = boto3.client('agent-registry-control')

response = client.quarantine_registered_workload(
    registryId='<registryId>',
    recordId='<recordId>',
    reason='Agent is calling an unapproved external endpoint'
)
print(f"QuarantineStatus: {response['quarantineStatus']}")  # QUARANTINING
```

## Unquarantine a workload
<a name="registry-quarantine-unquarantine"></a>

### Console
<a name="registry-quarantine-unquarantine-console"></a>

1. Open the [AWS Agent Registry console](https://console.aws.amazon.com/agent-registry/home?region=us-east-1#) and choose the registry.

1. Choose **Unquarantine**, either from the **Manage** menu with the record selected, or from the quarantine banner on the record details page. Both open the same dialog, which shows the quarantine reason if this registry placed the quarantine.

1. Enter `confirm`, then choose **Unquarantine**. Unquarantine takes no reason.

The record’s **Quarantine status** changes to **Unquarantine in progress**. The record becomes discoverable again after the unquarantine finishes.

 **Unquarantine** is unavailable while a quarantine or unquarantine is still in progress, and while auto-detection is turned off for the registry. The console shows the action anyway and tells you which condition applies.

### AWS CLI
<a name="registry-quarantine-unquarantine-cli"></a>

```bash
aws agent-registry-control unquarantine-registered-workload \
  --registry-id "<registryId>" \
  --record-id "<recordId>" \
  --region us-east-1
```

### AWS SDK
<a name="registry-quarantine-unquarantine-sdk"></a>

```python
import boto3

client = boto3.client('agent-registry-control')

response = client.unquarantine_registered_workload(
    registryId='<registryId>',
    recordId='<recordId>'
)
print(f"QuarantineStatus: {response['quarantineStatus']}")  # UNQUARANTINING
```

## Check the quarantine status
<a name="registry-quarantine-check"></a>

### Console
<a name="registry-quarantine-check-console"></a>

The console shows quarantine as a separate column and section, not as part of the record’s approval status.

On the registry details page:
+ The records table has a **Quarantine status** column, shown by default. Records that aren’t quarantined show a placeholder.
+ You can filter the table on **Quarantine status**.
+ The statistics above the table include a **Quarantined** count.

On a record details page:
+ A banner shows while the record has any **Quarantine status**. The banner’s wording follows the status, and the **Quarantined** banner carries an **Unquarantine** button.
+ The **Quarantine** section shows the **Quarantine status**. On the record that placed the quarantine, the section also shows the **Quarantine reason**, **Quarantined by**, and **Quarantined at**.

The following table maps each `quarantineStatus` value to the label and banner header that the console shows for it.


|  `quarantineStatus`  | Console label | Banner header | 
| --- | --- | --- | 
|  `QUARANTINING`  | Quarantine in progress | Quarantine in progress | 
|  `QUARANTINED`  | Quarantined | This record is quarantined | 
|  `UNQUARANTINING`  | Unquarantine in progress | Unquarantine in progress | 

### AWS CLI
<a name="registry-quarantine-check-cli"></a>

```bash
aws agent-registry-control get-registry-record \
  --registry-id "<registryId>" \
  --record-id "<recordId>" \
  --region us-east-1
```

On the record that placed the quarantine, the response includes the quarantine fields. The following excerpt omits the other record fields:

```json
{
  "recordId": "<recordId>",
  "status": "APPROVED",
  "quarantineStatus": "QUARANTINED",
  "quarantineReason": "Agent is calling an unapproved external endpoint",
  "quarantinedBy": "111122223333",
  "quarantinedAt": "2026-12-01T18:30:00Z"
}
```

On other records for the same agent runtime, the response includes only `quarantineStatus`. When the record isn’t quarantined, the response has none of these fields.

### AWS SDK
<a name="registry-quarantine-check-sdk"></a>

```python
import boto3

client = boto3.client('agent-registry-control')

record = client.get_registry_record(
    registryId='<registryId>',
    recordId='<recordId>'
)
print(record.get('quarantineStatus'))  # absent when not quarantined
print(record.get('quarantineReason'))  # only on the record that placed the quarantine
```

For errors you might get from these operations, see [Quarantine errors](registry-troubleshooting.md#registry-troubleshooting-quarantine).