> Every Sentinel doc, as Markdown: https://runsentinel.app/llms.txt

# Sentinel

Security monitoring for Stacks and Clarity contracts. Sentinel reads your contract's code, watches who acts and what moves, and alerts your team once it lands onchain.

## What Sentinel watches

Most losses on Stacks start with a stolen key, a rogue admin or a malicious proposal, not a clever bug. So the watches are about behavior:

| Watch | Fires when |
|---|---|
| **Outflow** | One transfer of a token leaves the contract above your threshold, in token units |
| **Outflow window** | The sum leaving within N blocks passes a threshold |
| **Who acts** | A new caller, a first-ever call, or a role change on a privileged function |
| **Caller allowlist** | Anyone outside the list calls a watched function |
| **Value to a new actor** | Funds reach an address the contract never paid before |
| **Governance and upgrades** | A proposal or an implementation swap lands |

## Why it reads your code

A generic chain alert doesn't know your contract. Sentinel reads the code first: which functions move value, who can call them, which powers someone holds by design. That read is the menu of what is watchable, and each entry says what the code lets someone do.

It is not a safety verdict. An empty menu never means "safe".

> A plan says what the code can do, nothing more. It never says a contract is safe, and an alert is a correlation, never a confirmed attack.

## How it goes

1. **Describe.** Paste a contract id. Sentinel returns what is watchable, read from the code, free and in seconds. Choose what to watch.
2. **Watch.** Sign in and add the watches you chose. On Builder or Team they are live at once; on Free a mainnet watch is saved and waits, and `test-alert` sends its newest real past match.
3. **Alert.** An alert reaches email, Slack or a signed webhook once the block holding the event is made. It says what happened and what to check first. Your team responds.

How long that takes is measured, not promised: block-to-alert p50 and p95 over 24 hours and 7 days are public at `GET /v1/status` (`sentinel status`).

Sentinel never acts onchain, never signs and never discloses on its own. A person decides.

> **Read only**
>
> Sentinel only reads. Nothing it does sends a transaction, and nothing from a repo you paste is ever run.

## Install

```sh
$ npm i -g @secondlayer/sentinel
$ sentinel login
$ npx skills add https://runsentinel.app
$ claude mcp add --transport http sentinel https://api.runsentinel.app/mcp
```

The CLI and the sign-in, then the agent skill (it installs into the project), then the hosted MCP server. Take the ones you use.

## Pick your surface

Sign-in, billing and API keys stay on the account page (`/account`). Everything after that works from a terminal, an agent or code. The same step on each surface:

**CLI**

```sh
$ sentinel on w_example
```

**MCP**

```txt
on { target: "w_example" }
```

**SDK**

```ts
await sentinel.on("w_example");
```

**curl**

```sh
curl -X POST https://api.runsentinel.app/v1/watches/w_example/state \
  -H "Authorization: Bearer $SENTINEL_API_KEY" \
  -H "content-type: application/json" \
  -d '{"on":true}'
```

Next: [Monitor a Stacks contract](/docs/monitor-a-stacks-contract), then the [Quickstart](/docs/quickstart).
