SolonGate Logo
  • Docs
  • Pricing
Sign inBook a Demo

Loading...

IntroductionPrerequisitesQuick StartAPI KeysInstallationPoliciesPrompt Inj. DetectionAI JudgeAgent Trust MapOpenClawDashboard Guide
GitHub

# Installation

Install the SolonGate SDK for TypeScript or use the proxy CLI directly.

Prerequisites: Make sure you have Node.js v18+ installed. See Prerequisites for details.

TypeScript SDK

bash
1npm install @solongate/proxy@latest

Basic Usage

typescript
1import { SolonGate } from '@solongate/proxy';
2
3// Initialize — reads SOLONGATE_API_KEY from .env automatically
4const gate = new SolonGate({ name: 'my-app' });
5
6// Validate a tool call
7const result = await gate.executeToolCall(
8 { name: 'file_read', arguments: { path: '/data/doc.txt' } },
9 async () => ({ content: [{ type: 'text', text: '...' }] }),
10);
11
12console.log(result); // tool result or policy denial

Package Exports

typescript
1import {
2 SolonGate, // Security gateway wrapper
3 PolicyEngine, // Policy evaluation
4 TrustLevel, // UNTRUSTED | VERIFIED | TRUSTED
5 Permission, // READ | WRITE | EXECUTE
6 RateLimiter, // Token-bucket rate limiting
7 TokenIssuer, // Capability tokens
8 ServerVerifier, // Request verification
9} from '@solongate/proxy';

Environment Setup

Create a .env file in your project root:

bash
1# .env
2# Get your keys from: https://dashboard.solongate.com → Projects → API Keys
3# IMPORTANT: Never commit this file to git!
4
5# Live key — connects to api.solongate.com for policy sync + audit logging
6SOLONGATE_API_KEY=sg_live_your_key_here
7
8# Test key — offline mode, no API connection (for development)
9# SOLONGATE_API_KEY=sg_test_your_key_here

Tip: If you use npx @solongate/proxy@latest init, a .env file is created automatically with placeholder keys.

Security Proxy (No SDK Required)

If you just want to protect existing AI tools without writing code, use the proxy instead:

bash
1# Protect all AI tools — no code changes needed
2npx @solongate/proxy@latest init --all

AI Tool Flags

By default, hooks are installed for all supported AI tools. Use flags to target specific ones:

bash
1npx @solongate/proxy@latest init --all --claude-code --gemini
--claude-code--gemini--openclaw

See Policies documentation and Quick Start for details.

API KeysPolicies