> ## Documentation Index
> Fetch the complete documentation index at: https://praison.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Guardrails CLI

> CLI commands for guardrails in PraisonAI TypeScript

The `praisonai-ts` CLI provides the `guardrail` command for content validation.

```mermaid theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
graph LR
    User([User]) --> CLI[CLI]
    CLI --> Svc[Guardrails]

    classDef agent fill:#8B0000,stroke:#7C90A0,color:#fff
    classDef tool fill:#189AB4,stroke:#7C90A0,color:#fff

    class Svc agent
    class User,CLI tool
    classDef agent fill:#8B0000,color:#fff
    classDef tool fill:#189AB4,color:#fff

```

## Quick Start

**1. Simple Usage**

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
praisonai-ts guardrail check "Your content here"
```

**2. With Configuration**

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
praisonai-ts guardrail check "Content" --criteria "Must be professional" --json
```

# Guardrails CLI Commands

The `praisonai-ts` CLI provides the `guardrail` command for content validation.

## Check Content

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
# Check content against guardrails
praisonai-ts guardrail check "Your content here"

# Check with custom criteria
praisonai-ts guardrail check "Content" --criteria "Must be professional"

# Get JSON output
praisonai-ts guardrail check "Hello world" --json
```

**Example Output:**

```json theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
{
  "success": true,
  "data": {
    "status": "passed",
    "score": 0.95,
    "message": "Content passes validation"
  }
}
```

## SDK Usage

For programmatic guardrail usage:

```typescript theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
import { LLMGuardrail, builtinGuardrails } from 'praisonai';

// LLM-based guardrail
const guard = new LLMGuardrail({
  name: 'safety',
  criteria: 'Content must be safe and appropriate'
});
const result = await guard.check('Hello world');

// Built-in guardrails
const maxLength = builtinGuardrails.maxLength(100);
const lengthResult = await maxLength.run('Hello');
```

For more details, see the [Guardrails SDK documentation](https://praison.ai/docs/js/guardrails.md).

## Related

> [card] [Guardrails](https://praison.ai/docs/js/guardrails.md)
>
> Guardrails overview

> [card] [LLM Guardrail](https://praison.ai/docs/js/llm-guardrail.md)
>
> LLM Guardrail overview


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.