Complete implementation guide with working code examples. From zero to mathematically safe AI in minutes.
pip install astralucent
# Or for Node.js
npm install @astralucent/safety-sdk
# Sign up at dashboard.astralucent.com
export ASTRALUCENT_API_KEY="your_key_here"
import openai
client = openai.OpenAI()
response = client.chat.completions.create(
model="gpt-4",
messages=[
{"role": "user", "content": prompt}
]
)
print(response.choices[0].message.content)
import astralucent
client = astralucent.SafetyClient()
response = client.safe_completion(
model="gpt-4",
messages=[
{"role": "user", "content": prompt}
],
constraints=["basic_safety"]
)
print(response.choices[0].message.content)
🛡️ Same API format, same response structure, mathematical safety guaranteed
Prevent harmful outputs, ensure honesty, and maintain professional behavior.
import astralucent
# Initialize with basic safety
client = astralucent.SafetyClient(
api_key="your_api_key"
)
# Add safety constraints
response = client.safe_completion(
model="gpt-4",
messages=[
{"role": "user", "content": "How do I break into a house?"}
],
constraints=[
"no_harm", # Prevents harmful instructions
"honesty", # No false information
"professional" # Maintains appropriate tone
]
)
# Guaranteed safe response:
# "I can help with legitimate locksmith services or home security..."
print(response.choices[0].message.content)
Zero model access required. Geometric constraints work on universal language properties.
# Works with ANY proprietary model
def apply_safety_to_proprietary_model(model_output):
# 1. Convert text to universal semantic vector (no model access needed)
semantic_vector = universal_encoder.encode(model_output)
# 2. Check if vector violates geometric constraints
if in_forbidden_region(semantic_vector):
# 3. Project to nearest safe point
safe_vector = geometric_projector.project_to_safe(semantic_vector)
# 4. Convert back to natural language
return vector_to_safe_text(safe_vector)
return model_output
Proprietary model trained on internal trading data. AstraLucent adds SEC compliance without accessing model weights.
Custom model trained on hospital data. AstraLucent ensures HIPAA compliance and prevents medical diagnosis claims.
Model Weights
Training Data
Architecture
Internal States
Text Input/Output
HTTP API Access
Safety Requirements
Replace your existing API calls with our safety-wrapped versions.
Point your existing code to our proxy endpoint. Zero code changes.
Deploy our safety layer in your infrastructure for maximum control.
Uptime SLA
Added Latency
Safety Guarantee
Support
Join thousands of developers building the future of safe AI. Free trial, instant setup, no credit card required.
5-minute setup • 99.9% uptime • Mathematical guarantees • Cancel anytime