Guardy
Book a Demo Login

Documentation

Installation

Install the Guardy SDK in your project. Available for Python and TypeScript.

One-Line Install

Run this from the root of your agent repo:

curl -fsSL https://raw.githubusercontent.com/guardydev/Guardy/main/scripts/install.sh | bash

This bootstraps the Guardy CLI through npm, installs the right SDK package for your project, and writes a safe example integration file.

Options

# Preview without changing files
curl -fsSL https://raw.githubusercontent.com/guardydev/Guardy/main/scripts/install.sh | bash -s -- -- --dry-run

# Force Python setup when auto-detection is ambiguous
curl -fsSL https://raw.githubusercontent.com/guardydev/Guardy/main/scripts/install.sh | bash -s -- -- --language python

# Use the beta npm tag
curl -fsSL https://raw.githubusercontent.com/guardydev/Guardy/main/scripts/install.sh | bash -s -- --channel=beta

Python

Basic Installation

pip install guardy

With LangChain Support

pip install guardy langchain-core

# Or install all optional dependencies
pip install guardy[all]

Requirements

  • Python 3.9 or higher
  • requests library (installed automatically)
  • langchain-core (optional, for LangChain integration)

TypeScript / Node.js

npm
  npm install @guardy/sdk
pnpm
  pnpm add @guardy/sdk
yarn
  yarn add @guardy/sdk

Requirements

  • Node.js 18 or higher
  • TypeScript 5.0+ (for TypeScript projects)

Configuration

Set your API key as an environment variable for automatic configuration:

# .env file
GUARDY_API_KEY=guardy_live_xxxxxxxxxxxxx

# Optional: custom API URL (for self-hosted)
GUARDY_API_URL=https://api.tryguardy.com

Python Configuration

import guardy

# Option 1: Use environment variables (automatic)
guardy.configure()  # Reads GUARDY_API_KEY

# Option 2: Explicit configuration
guardy.configure(
    api_key="guardy_live_xxx",
    api_url="https://api.tryguardy.com"  # Optional
)

# Option 3: Create client directly
from guardy import GuardyClient
client = GuardyClient(api_key="guardy_live_xxx")

TypeScript Configuration

import { GuardyClient } from '@guardy/sdk';

// Create client with API key
const client = new GuardyClient({
  apiKey: process.env.GUARDY_API_KEY,
  // Optional: custom API URL
  apiUrl: 'https://api.tryguardy.com',
});

Getting Your API Key

Sign in to Guardy

Go to tryguardy.com and sign in.

Go to Settings

Navigate to Settings → API Keys in the sidebar.

Create API Key

Click "Create API Key", give it a name, and copy the key.

Verify Installation

Run this quick test to verify everything is working:

import guardy

# Configure
guardy.configure(api_key="guardy_live_xxx")

# Create a test session
interaction = guardy.begin(
    user_id="test_user",
    event="test_event",
    input="Testing Guardy installation"
)

# Finish it
interaction.finish(
    output="Installation verified!",
    success=True
)

print("Guardy is working correctly!")

Check your Guardy dashboard. You should see the test session appear within seconds.

Next Steps