Quick Start¶
Verify your first policy in 5 minutes.
1. Create a Policy¶
Create policy.py:
import numpy as np
def policy(observation: dict) -> np.ndarray:
"""Simple policy that moves toward objects."""
robot_pos = observation['robot_state'][:3]
objects = observation['object_positions']
if len(objects) == 0:
return np.zeros(7)
# Move toward nearest object
target = objects[0]
direction = target - robot_pos
direction = direction / (np.linalg.norm(direction) + 1e-6)
action = np.zeros(7)
action[:3] = direction * 0.5
return action
2. Package It¶
3. Verify¶
from botmanifold import BotManifoldClient
client = BotManifoldClient(api_key="bm_...")
# Run verification (blocks until complete)
report = client.verify.run("policy.zip", scenario="messy_room")
print(f"Verdict: {report.verdict}")
print(f"Score: {report.score}")
4. Check Detailed Results¶
# Verification report includes detailed breakdown
print(f"Safety Score: {report.safety_score}")
print(f"Progress Score: {report.progress_score}")
print(f"Video: {report.video_url}")
5. Arena Submission¶
# Submit to the arena for leaderboard ranking
submission = client.arena.submit("policy.zip", scenario="messy_room")
# Wait for completion
result = client.arena.wait(submission.id)
print(f"Verdict: {result.verdict}")
print(f"Score: {result.score}")
print(f"Video: {result.video_url}")
Complete Example¶
from botmanifold import BotManifoldClient
# Initialize (reads BOTMANIFOLD_API_KEY env var if api_key not passed)
client = BotManifoldClient(api_key="bm_...")
# Verify policy safety
print("Verifying policy...")
report = client.verify.run("policy.zip", scenario="messy_room")
print(f"Verdict: {report.verdict}")
print(f"Score: {report.score}")
print(f"Safety: {report.safety_score}")
print(f"Progress: {report.progress_score}")
if report.video_url:
print(f"Video: {report.video_url}")
Next Steps¶
- Writing Policies - Best practices
- API Reference - Full SDK documentation
- Scenarios - Available challenges