---
name: cscore-check
display_name: C-Score Check
description: "Check c-scores for AWS account IDs using Columbo (primary) with Baywatch as fallback. Use when the user asks to check c-scores, verify account fraud status, look up account risk scores, or flag accounts with low c-scores. After presenting results, offer to proceed with Matador allowlisting or MS-Form c-score upgrade if the score indicates restricted access — this invokes the 'bedrock-capacity-request' skill. Requires browser authentication via Midway."
icon: "🛡️"
trigger: check c-scores
inputs:
  - name: account_ids
    description: "Comma-separated list of AWS Account IDs (12-digit) to check c-scores for (e.g. '444975673530, 123456789012')"
    type: string
    required: true
  - name: region
    description: "AWS region code for Baywatch fallback (e.g. 'IAD', 'DUB', 'PDX'). Only needed if Columbo fails. If not provided and Baywatch is needed, ask the user."
    type: string
    required: false
tools: [browser_launch, browser_navigate, browser_click, browser_type, browser_wait, browser_read_page, browser_screenshot, browser_new_tab, run_python]
---

## Overview

This skill looks up c-scores (containment scores) for AWS account IDs. C-scores are used to determine:
- Whether an account can access certain Bedrock models
- What form/process to use for capacity requests
- Account risk/fraud tier

C-score thresholds:
- **< 210**: No access — FIT RIVER workflow required
- **210–300**: Low access — Matador allowlist needed before quota requests
- **301–349**: Model access limited — MS-Form c-score upgrade to reach 350+
- **350–600**: Standard access with TPD spend caps ($1K–$2.5K/day)
- **> 600**: Full access

## Workflow

### Step 1: Parse Account IDs

Parse `{{account_ids}}` into a list of 12-digit account IDs. Validate format.

### Step 2: Look Up Each C-Score

For each account ID, attempt lookup in this order:

#### Columbo Direct URL (Primary)
Navigate to:
```
https://fraudtools.prod.us-east-1.columbo.fraud.aws.dev/#/investigations/globalsearch/33d23537-ac95-4061-abf1-20c1c19842ca?awsAccountId={{account_id}}
```
Wait for "Entity" text, read page, extract **Default C-Score**.

#### Columbo Search Form (Fallback)
1. Navigate to Columbo investigations page
2. Select "AWSAccountId" workstream
3. Type account ID and search
4. Extract c-score from results

#### Baywatch (Last Resort)
Navigate to:
```
https://ec2-baywatch-prod-iad.iad.proxy.amazon.com/pages/accountInfo?accountId={{account_id}}&region={REGION_CODE}
```
Wait for "Containment score", extract value.

### Step 3: Generate Report

For each account, produce a markdown report:
```
**Account: {{account_id}}**
- C-Score: [value]
- Access Tier: [No Access / Model Access Limited / Low Access / Standard / Full]
- TPD Spend Cap: [$X/day] (if applicable)
- Recommended Action: [description]
```

### Step 4: Offer Next Steps

Based on the c-scores, present a decision card:

**If any account has c-score < 210:**
> ⚠️ Account {id} has c-score < 210 — FIT RIVER workflow required. No automated form available.

**If any account has c-score 210–349:**
> I can submit an MS-Form to upgrade the c-score to 350+ for model access.
> - Yes — file capacity request
> - No thanks

**If any account has c-score 210–300 and needs quota:**
> This account needs Matador allowlisting before quota requests can be approved.
> - Yes — file allowlist request
> - No thanks

**If any account has c-score 350+:**
> Ready for Bedrock capacity requests.
> - Submit capacity request

## Error Handling

- **Browser not available**: "This skill requires browser automation. Please enable browser tools in Settings → Capabilities."
- **Midway auth required**: Ask user to authenticate in browser window, then continue.
- **C-score not found**: If Columbo and Baywatch both fail, ask user to provide c-score manually.
- **Invalid account ID format**: Warn user and skip invalid entries.

## Integration

This skill is invoked by `bedrock-capacity-request` when `{{cscore}}` is not provided. It chains seamlessly — after reporting c-scores, it can hand off to the capacity request skill with the confirmed c-score values.
