# AI use cases for Cosy Redact Gateway (CassiopeiaCode/CosyRedactGateway)

Repo: [CassiopeiaCode/CosyRedactGateway](https://github.com/CassiopeiaCode/CosyRedactGateway) | Use cases: 4 | Page: https://dedupedai.com/use-cases/cassiopeiacode-cosyredactgateway/

A lightweight, stateless privacy gateway that sits between your app and LLM APIs, redacting detected secrets and sensitive values before they reach OpenAI or Anthropic upstreams and restoring placeholders in responses.

This file holds every use case of this repo. Each one starts with a "## " heading and ends with its URL.

- Check high-entropy secret detection offline in minutes: https://dedupedai.com/use-cases/cassiopeiacode-cosyredactgateway/verify-high-entropy-detection-offline/
- Redact secrets from Anthropic SDK calls locally: https://dedupedai.com/use-cases/cassiopeiacode-cosyredactgateway/route-anthropic-sdk-calls-through-local-gateway/
- Deploy the gateway to Cloudflare Workers with host limits: https://dedupedai.com/use-cases/cassiopeiacode-cosyredactgateway/deploy-gateway-to-cloudflare-workers/
- Route an IDE assistant's API traffic through the gateway: https://dedupedai.com/use-cases/cassiopeiacode-cosyredactgateway/point-ide-assistant-at-gateway/

## How to check high-entropy secret detection offline in minutes with Cosy Redact Gateway

Repo: [CassiopeiaCode/CosyRedactGateway](https://github.com/CassiopeiaCode/CosyRedactGateway) | Difficulty: Intermediate | Time: 15 minutes | Basis: From the README

Run a local demo that shows how the gateway handles an unlabeled random string with and without detection.

**Who it is for:** A developer or security reviewer who wants proof that the gateway catches random credentials without a known prefix before trusting it with real prompts.

**The problem:** Vendor claims about secret detection are hard to judge without seeing how the detector treats a value that has no key prefix or password label.

**The outcome:** You see the gateway's output for the same synthetic string under three detector settings, plus the exact restore check, without any network call or API key.

### Steps

1. Clone the repository with `git clone https://github.com/CassiopeiaCode/CosyRedactGateway.git`
2. Enter the project folder with `cd CosyRedactGateway`
3. Run the offline demo with `node scripts/demo-high-entropy.mjs`
4. Run the regression and entropy tests with `npm test` and `npm run entropy-report`

### Prompt to paste into your agent

```text
Clone https://github.com/CassiopeiaCode/CosyRedactGateway, run `node scripts/demo-high-entropy.mjs` from the repo root, and report the output for the PSIBEG, H, and all-enabled settings. Verify that the restore check passes and state that the results describe only the synthetic samples, not production leak rates.
```

### Caveat

The demo and calibration numbers use synthetic samples only, so they do not measure how the gateway performs on your own data.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/cassiopeiacode-cosyredactgateway/verify-high-entropy-detection-offline/

## How to redact secrets from Anthropic SDK calls locally with Cosy Redact Gateway

Repo: [CassiopeiaCode/CosyRedactGateway](https://github.com/CassiopeiaCode/CosyRedactGateway) | Difficulty: Intermediate | Time: 30 minutes | Basis: From the README

Send Anthropic Messages API calls through the local gateway with detection on, using the JavaScript SDK.

**Who it is for:** A JavaScript developer building an app on the Anthropic SDK who needs secrets in prompts stripped before they reach Anthropic.

**The problem:** Anthropic requests carry whatever text the app builds, including tokens pasted from configs or tool output, and those values leave the machine unchanged.

**The outcome:** Your Anthropic SDK calls go through the gateway with all detectors enabled, and you can confirm the placeholder flow with a synthetic value.

### Steps

1. Start the gateway from the repo folder with `npm start`
2. Install the SDK in your app with `npm install @anthropic-ai/sdk` (inferred, check the README)
3. Export your settings with `export ANTHROPIC_API_KEY=<your-key>` and `export ANTHROPIC_MODEL=<model-name>` (inferred, check the README)
4. Set the client baseURL to `http://127.0.0.1:8787/$https://api.anthropic.com` and save the example as a `.mjs` file, then run it with `node <file>.mjs` (inferred, check the README)

### Prompt to paste into your agent

```text
Start the CosyRedactGateway with `npm start` and create a Node script in <your-app-path> that uses `@anthropic-ai/sdk` with baseURL `http://127.0.0.1:8787/$https://api.anthropic.com`. Run it with a synthetic value and confirm the output, noting that the SDK appends `/v1/messages` and that no extra `/v1` should be added to the base URL.
```

### Caveat

The README does not guarantee every Anthropic streaming schema, so test the exact event types your app uses with synthetic data first.

Risk, credentials: The Anthropic API key is sent upstream as an authentication header, so keep it out of logs and shared scripts.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/cassiopeiacode-cosyredactgateway/route-anthropic-sdk-calls-through-local-gateway/

## How to deploy the gateway to Cloudflare Workers with host limits with Cosy Redact Gateway

Repo: [CassiopeiaCode/CosyRedactGateway](https://github.com/CassiopeiaCode/CosyRedactGateway) | Difficulty: Advanced | Time: 60 minutes | Basis: From the README

Publish worker.js as a Cloudflare Worker and restrict which upstream hosts it will call.

**Who it is for:** A team lead or DevOps engineer who needs a shared, hosted redaction layer for several developers and has a Cloudflare account.

**The problem:** Each developer running a local gateway is hard to manage, and an unconfigured hosted gateway could forward requests to any destination.

**The outcome:** A Cloudflare Worker running the gateway, with an upstream allowlist set as a Worker variable and tests passing before deployment.

### Steps

1. Run the test suite from the repo folder with `npm test`
2. Deploy the Worker with `npx wrangler deploy`
3. Set the Worker variable `REDACT_ALLOWED_HOSTS=api.openai.com,api.anthropic.com` in the Cloudflare dashboard
4. Add access control in front of the Worker before sharing its URL, as the README advises for public exposure (inferred, check the README)

### Prompt to paste into your agent

```text
In the CosyRedactGateway repo, run `npm test` and then `npx wrangler deploy` for the account in <your-cloudflare-account>. Confirm the deployed Worker rejects a request to a host not in REDACT_ALLOWED_HOSTS and state that host allowlisting does not authenticate callers.
```

### Caveat

The README says the allowlist limits target hosts but does not authenticate callers, so the Worker must have outside access control before any public traffic.

Risk, credentials: The hosted Worker receives raw requests and provider credentials, so you must trust the hosting environment and add your own access control.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/cassiopeiacode-cosyredactgateway/deploy-gateway-to-cloudflare-workers/

## How to route an IDE assistant's API traffic through the gateway with Cosy Redact Gateway

Repo: [CassiopeiaCode/CosyRedactGateway](https://github.com/CassiopeiaCode/CosyRedactGateway) | Difficulty: Advanced | Time: 45 minutes | Basis: From the README

Set a custom API base URL in a coding assistant so its requests pass through the redaction layer.

**Who it is for:** A developer using an IDE or CLI coding assistant that accepts a custom base URL and who regularly pastes code containing internal tokens.

**The problem:** Assistant requests include file contents and tool results, which can carry tokens that have no known key format.

**The outcome:** The assistant's supported requests go through the local gateway, and you have checked the actual request path with synthetic data before using it on sensitive work.

### Steps

1. Start the gateway from the repo folder with `npm start`
2. Confirm the service is running with `curl --fail --silent --show-error http://127.0.0.1:8787/healthz`
3. Set the assistant's custom base URL to `http://127.0.0.1:8787/$https://api.openai.com/v1` or the Anthropic-style form from the README table, matching the protocol it uses
4. Send a synthetic test prompt and check the gateway's behavior before using real code

### Prompt to paste into your agent

```text
Start the CosyRedactGateway with `npm start`, then configure <assistant-name> to use base URL `http://127.0.0.1:8787/$https://api.openai.com/v1` or the Anthropic-style form as its protocol requires. Send a synthetic test value and report whether the assistant's request reaches the gateway, noting that the README makes no specific compatibility guarantee for this tool.
```

### Caveat

The README does not certify compatibility with any specific assistant version, so verify the real request path with synthetic data before relying on it.

Risk, credentials: Assistants that run remotely cannot reach 127.0.0.1 on your machine, and the assistant's auth headers are forwarded upstream by design.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/cassiopeiacode-cosyredactgateway/point-ide-assistant-at-gateway/
