Quickstart Guide
Get up and running with PrecogX in 5 minutes.
Prerequisites
- Python 3.8+ or Node.js 16+
- A PrecogX account (sign up free)
Step 1: Create Your Account
- Visit app.precogx.ai
- Click "Start Free"
- Complete the signup form (no credit card required)
- Verify your email address
Step 2: Get Your API Key
- Log into your PrecogX Dashboard
- Navigate to Settings → API Keys
- Click "Generate New Key"
- Copy your API key (you'll need this for the SDK)
Keep it secure
Store your API key securely. Never commit it to version control or share it publicly.
Step 3: Install the SDK
Python
pip install precogx-sdk
JavaScript/Node.js
npm install @precogx/sdk
Step 4: Initialize the Client
Set your agent_id once when initializing the client — you never need to repeat it on every call.
Python
from precogx_sdk import PrecogXClient
client = PrecogXClient(
api_key="your_api_key_here",
agent_id="my-first-agent", # set once here, applied to every call automatically
)
JavaScript
import { PrecogXClient } from '@precogx/sdk';
const client = new PrecogXClient({
apiKey: 'your_api_key_here',
agentId: 'my-first-agent', // set once here, applied to every call automatically
});
What is agent_id?
The agent_id is a name you choose to identify this agent in your PrecogX dashboard (e.g. "support-bot", "invoice-processor"). Each unique name counts as one agent toward your plan limit. Use the same name every time the same agent runs so its trust score and history accumulate correctly.
Step 5: Send Your First Telemetry
Python
# agent_id is applied automatically — no need to repeat it on every call
result = client.send_telemetry({
"prompt": "Hello, how can I help you today?",
"response": "I'm here to assist you with any questions you might have.",
"tool_calls": []
})
if result["flags"]:
print(f"🚨 Threat detected: {result['flags'][0]}")
else:
print("✅ No threats detected")
print(f"Risk Score: {result['risk_score']}")
JavaScript
// agentId is applied automatically — no need to repeat it on every call
const result = await client.sendTelemetry({
prompt: 'Hello, how can I help you today?',
response: 'I\'m here to assist you with any questions you might have.',
toolCalls: []
});
if (result.flags.length > 0) {
console.log(`🚨 Threat detected: ${result.flags[0]}`);
} else {
console.log('✅ No threats detected');
}
console.log(`Risk Score: ${result.riskScore}`);
Step 6: View Results in Dashboard
- Return to your PrecogX Dashboard
- Navigate to Detections to see your telemetry data
- Check Overview for trust score analytics
- Review Agents to see your agent's security status
Next Steps
- Installation Guide - Detailed setup instructions
- First Agent - Create your first protected agent
Need Help?
Congratulations! You've successfully set up PrecogX and sent your first telemetry data. Your AI agents are now protected by enterprise-grade security.