# HIPS

> HIPS runs a centrally managed AI inference marketplace on a distributed GPU network. It connects people buying inference with independently supplied GPU time.

## Guardrails
Route: https://hips.com/inference/guardrails

# Guardrails

Spending limits, model and pool access, and content moderation, assigned to the workspace, a member, an API key or a tool's sign-in, and applied by the gateway to every request.

A guardrail is a rule the gateway applies to every request of what it is assigned to, before any model runs. It has an id (`grd_...`), a name, one of three types, its settings, its assignees and a state, `on` or `off`: one that is off applies to no request and keeps its settings and assignees. Guardrails are made, changed and assigned in the Console's Guardrails; there is no API route for them.

> Guardrails are on in production: budgets, model and pool access, the pattern checks and the checks a decision service judges (prompt injection, and the person name, postal address and other personal data patterns). When that service fails, gets no answer within the check's deadline, or the day's checks are used up, the check has no answer: a guardrail that blocks or redacts refuses the request with 503 `guardrail_unavailable` (the request is not charged, only what the check read and, from November 28, 2026, on a routed request, its read), and one that flags lets the request go on and says the check could not run. A guardrail that redacts never lets through text it could not check. Where the request itself kept the check from being asked, the refusal names why: `region` for [a request that requires a region](/docs/guardrails#a-request-that-requires-a-region), `workspace_share` once the workspace's own share of the day is used up, which its own requests can do, and `day_share` once it holds its part of what is left of the day.

| Type | Name | What it does |
| --- | --- | --- |
| Budget | `budget` | A spending limit with a reset interval. Each assignee counts on its own, never pooled. |
| Model and pool access | `access` | Which models, pools and regions requests may use, and whether they may move to another pool. |
| Content moderation | `content_moderation` | Detects prompt injection and sensitive information, and flags, redacts or blocks it. |

### Budgets

*A budget's settings*

- `limit_micros` (micro-dollars): The spending limit, a positive whole number (the Console takes dollars).
- `reset` (`day`, `week`, `month`, `never`): Every day at 00:00 UTC, every Monday at 00:00 UTC, the 1st of each month at 00:00 UTC, or never: a lifetime limit.
- `alerts` (fractions): Up to five fractions of the limit, above 0 and at most 1 (`0.5`, `0.8`). At each, the owners and admins, and a member it is assigned to, are told by email and in the Console, once per period.
- `action_at_limit` (`block`, `alert`): `block`, the default: the assignee's requests are refused until the reset. `alert`: they go on, and crossing the limit is told.

- Each assignee has its own counter, never pooled: a budget assigned to five keys gives each key the whole limit each period, and one assigned to the workspace is one counter for all of the workspace's requests. A rotated key keeps its counter.
- Every charge of the assignee's own requests counts, a content moderation check's charge included.
- A request is admitted while its counter has anything left, its whole maximum charge held until it is settled, so a counter can pass its limit by what the requests then in flight cost. While what is left is held by requests in flight, a request is answered 503 `guardrail_unavailable`, retry after one second, never 402.
- At the limit with `block` the answer is 402 `budget_exceeded`, naming the guardrail, with `resets_at`, the end of the period (`null` for `never`). It is never a payment challenge: requests resume at the reset, or once the limit is raised or the guardrail turned off.

### Model and pool access

*An access guardrail's settings*

- `models` (`{"allow": [...]}` or `{"deny": [...]}`): Up to 256 entries: catalog ids (each covers every version), aliases, pinned ids, a family as `<family>-*`, the workspace's deployments (`dep_...`), or a model type: `language`, `image`, `video`, `audio`, `vision`, `classifier`, `specialist`, or a task such as `chat`, `embedding`, `rerank`, `speech`, `transcription`. Entries are lowercase, with `*` only at the end, as `-*`. A model is judged by every name it answers to, the ids it had before a rename included.
- `pools` (`community`, `certified`): The pools allowed. Auto, the default, chooses only among them. A request that names a pool outside them is 403 `pool_not_allowed`; a key's or a tool's default pool outside them runs as Auto.
- `regions` (region codes): The region requirements allowed, on the Business plan, which includes region selection: a request naming a region outside it is 403 `region_not_allowed`. Below the Business plan, a request that names a region is 403 `region_not_on_plan`.
- `fallback` (`true`, `false`): `true` by default. `false` forbids moving a request to another allowed pool when its own has no capacity, whatever a key or a request asks.

An access guardrail restricts something: models, pools, regions, or fallback off. Several combine as their intersection, so a request may use only what every one of them allows, and a refusal names the guardrail that refused: 403 `model_not_allowed`, `pool_not_allowed` or `region_not_allowed`. With a router name in `model`, an access guardrail narrows the models the router may choose ([Semantic routing](/docs/router)).

### Content moderation

Two checks, each switched on or off in the guardrail, each with its own action and the messages it scans. The checks read text only: images and files are not scanned. Answers are not scanned either, and the gateway never edits an answer.

| Check | Detects | How |
| --- | --- | --- |
| Prompt injection (`injection`) | Text that tries to override the model's instructions, such as a fetched page or a pasted document | Judged by a decision service, part by part |
| Sensitive information (`sensitive`) | The patterns chosen, and custom patterns | The patterns are found in the gateway; person names, postal addresses and other personal data are judged by a decision service |

| Pattern | Matches | Found by |
| --- | --- | --- |
| `email` | Email addresses | The gateway |
| `phone` | Phone numbers | The gateway |
| `ssn` | United States Social Security numbers, reserved ranges excluded | The gateway |
| `card` | Credit card numbers, their checksum verified | The gateway |
| `iban` | IBANs, their checksum verified | The gateway |
| `ip` | IP addresses, v4 and v6 | The gateway |
| `secret` | API keys and secrets: HIPS's own keys and tokens, the known formats of other services, JSON web tokens and private key blocks | The gateway |
| `name` | Person names, offered as early | A decision service |
| `address` | Postal addresses, offered as early | A decision service |
| `personal` | Other personal data the chosen patterns do not cover | A decision service |

A custom pattern is a name and a regular expression. Its name is 1 to 40 letters, digits and `_`, starting with a letter, and becomes its placeholder (`ticket` gives `[TICKET_1]`). Its expression is compiled when it is saved, by an engine whose time is linear in the text, so lookarounds and backreferences are not accepted; one that does not compile, that can match an empty span or that can match nothing is refused. Write ASCII classes such as `[A-Za-z0-9_]` in place of `\w` to stay within the compiled size.

| Setting | Values |
| --- | --- |
| `action` | `flag`: the request goes on unchanged, and the answer names the guardrail. `redact`: each match is replaced before any model sees it, and a request the check cannot read in full is refused rather than sent unchecked. `block`: the request is refused before any model runs, 400 `guardrail_blocked`, uncharged |
| `scan` | `all`: every message, system and developer, user, the assistant's earlier turns and tool results, the default for sensitive information. `inputs`: what did not come from your own instructions or the model, user messages and tool results, the default for prompt injection. `last_turn`: the newest user message and every message after it |
| `applies` | `every_pool`, the default: every request. `community_only`: only attempts placed in the Community pool, so the Certified pool's GPUs receive the full, unredacted text |

Redaction replaces sensitive information with a typed placeholder numbered within the request, the same value always the same placeholder, so the model can still tell two addresses apart. A part judged a prompt injection is replaced with the sentence "[Removed by a guardrail: content suspected of prompt injection.]", the rest of the message kept. With a guardrail that redacts `email` and a custom pattern `ticket` (`TCK-[0-9]{4}`), scanning every message:

The messages sent:

```
system:  Support desk for ops@example.com.
user:    Mail jane@example.com or bob@example.com, then jane@example.com. Ticket TCK-1234.
```

What the model receives:

```
system:  Support desk for [EMAIL_1].
user:    Mail [EMAIL_2] or [EMAIL_3], then [EMAIL_2]. Ticket [TICKET_1].
```

### Assignment

| Assignee | What it covers |
| --- | --- |
| The workspace | Every request the workspace makes: every key, every person's tools, the Playground |
| A member | That person's own requests in the workspace: their tools' sign-ins and their Playground runs; never an API key, which belongs to the workspace whoever made it |
| An API key | Every request made with the key |
| A tool's sign-in (`dva_...`) | One tool on one computer, such as `hi` or HIPS Code, signed in by a person |

Every guardrail that is on and assigned to the workspace, to the request's credential or to its person applies, all of them:

| Type | How several combine |
| --- | --- |
| Budget | Each counter on its own: a request is refused when any one with `block` is at its limit |
| Model and pool access | The intersection: what every one allows |
| Content moderation | Every check switched on runs; where two act on one match the strictest action wins (`block`, then `redact`, then `flag`), and the widest messages to scan |

A key's or a tool's defaults (its pool, region and fallback) stay defaults: a request may override a default, never a guardrail. A default outside a guardrail is refused when it is saved, 400 `requirement_conflict` naming the guardrail. Owners and admins read and set every guardrail; the billing role reads and sets budgets; a developer reads none.

### What checks cost

Budgets, access and the pattern checks cost nothing. A check a decision service judges is charged by the input tokens the decision service counted, as a usage record of its own marked `guardrail`, and counts toward budgets. From November 28, 2026, it is charged USD 0.0525 per million of them. A request a check blocks or could not check is not charged, only what the check read.

### Data handling

- A matched value and a redacted original stay in the gateway's memory for the request alone: never stored, logged, returned or sent to a model's server. Answers and the Console name guardrails, checks, messages and counts per pattern type, never a value.
- Redaction happens before any GPU receives the request, so a provider's device in the Community pool receives only the redacted text. With `community_only`, only the attempts placed in the Community pool are redacted.
- A check a decision service judges sends it only the parts the guardrail scans, after the patterns' redaction, for the one call; the service is run outside HIPS. A verdict is kept for a bounded time under a keyed hash of the workspace and the text, never the text, so a conversation's earlier turns are not judged again.
- A request that requires a region sends nothing to the decision service: the checks it judges are not run for that request, as [A request that requires a region](/docs/guardrails#a-request-that-requires-a-region) says.
- Custom patterns are the workspace's configuration, stored with the guardrail and shown to its owners and admins.

Docs: https://hips.com/docs/guardrails


## For AI agents
- API: https://ai.hips.com/v1, OpenAI-compatible; the key is read from HIPS_API_KEY.
- Models: GET https://ai.hips.com/v1/models with the key, or https://hips.com/api/models without one.
- hi, the HIPS command line: curl -fsSL https://hips.com/hi.sh | sh, then hi models.
- Every page above as Markdown: its address plus .md (the home page at https://hips.com/index.md), or its address with Accept: text/markdown.
