---
slug: "sensitive-browser"
source_type: "readme"
source_url: "https://cdn.jsdelivr.net/gh/napoleond/sensitive-browser@main/README.md"
repo: "https://github.com/napoleond/sensitive-browser"
source_file: "README.md"
branch: "main"
---
# sensitive-browser

A CLI tool for executing sensitive browser actions (login, payments, form filling) outside of the core agent loop. Designed to integrate with agentic browsing workflows.

## Installation

```bash
npm install -g sensitive-browser
# or
npx sensitive-browser <task> [options]
```

## Prerequisites

- Node.js 18+
- `ATXP_CONNECTION_STRING` environment variable set

## Usage

```bash
npx sensitive-browser <task> \
  --sensitive-data ./creds.json \
  --url https://example.com/login \
  --state ./session.json \
  --output ./session.json
```

### Options

| Option | Description |
|--------|-------------|
| `<task>` | The task to perform (e.g., "log in with credentials") |
| `-s, --state <path>` | Path to Playwright storage state JSON file |
| `-d, --sensitive-data <path>` | Path to sensitive data JSON file (required) |
| `-u, --url <url>` | Target URL to navigate to |
| `-o, --output <path>` | Output path for updated state (defaults to --state) |

## Sensitive Data Format

Create a JSON file with your sensitive data:

```json
{
  "credentials": {
    "username": "user@example.com",
    "password": "secret"
  },
  "payment": {
    "cardNumber": "4111111111111111",
    "expiry": "12/28",
    "cvv": "123",
    "billingZip": "94102"
  },
  "personal": {
    "fullName": "Jane Doe",
    "phone": "+1-555-0123",
    "address": "123 Main St"
  }
}
```

## Workflow Integration

### With agent-browser

```bash
# Start a session with agent-browser
agent-browser --session myapp open https://example.com
agent-browser --session myapp state save ./session.json

# Hand off to sensitive-browser for login
npx sensitive-browser "log in with credentials" \
  --state ./session.json \
  --sensitive-data ./creds.json

# Continue with agent-browser
agent-browser --session myapp state load ./session.json
agent-browser --session myapp snapshot
```

### Standalone

```bash
npx sensitive-browser "fill out the checkout form with payment info" \
  --url https://store.example.com/checkout \
  --sensitive-data ./payment.json \
  --output ./checkout-state.json
```

## Security Notes

- Sensitive data is never logged or displayed
- The tool shows which sensitive fields will be used, but not their values
- Store sensitive data files securely (consider using environment variables or secret managers)

## Development

```bash
# Install dependencies
npm install

# Build
npm run build

# Run locally
node dist/index.js "task" --sensitive-data ./test-creds.json --url https://example.com
```

## License

MIT
