Running & Testing
Start the gateway and test ArmorIQ intent verification
Running & Testing
Start the OpenClaw gateway and verify the ArmorIQ integration is working correctly.
Starting the Gateway
Navigate to Project Directory
cd /path/to/aiq-openclawBuild (if not already built)
pnpm buildStart the Gateway
# Development mode with verbose logging
node scripts/run-node.mjs --dev gateway# Production mode
node scripts/run-node.mjs gateway# Run in background
node scripts/run-node.mjs --dev gateway &
# Or with nohup
nohup node scripts/run-node.mjs --dev gateway > gateway.log 2>&1 &Verify Startup
Expected console output:
[openclaw] Building TypeScript (dist is stale).
[plugins] IAP Verification Service initialized - Base URL: https://customer-api.armoriq.ai
[plugins] CSRG Verification URL: https://customer-iap.armoriq.ai
[plugins] CSRG /verify/action is ENABLED for cryptographic verification
[gateway] agent model: openai/gpt-4-turbo
[gateway] listening on ws://127.0.0.1:19001 (PID 12345)
[gateway/channels/telegram] [default] starting provider (@your_bot)The gateway listens on port 19001 by default. Telegram integration starts automatically if configured.
Viewing Logs
Log Location
Gateway logs are written to:
/tmp/openclaw/openclaw-YYYY-MM-DD.logWatch Logs in Real-time
# All logs
tail -f /tmp/openclaw/openclaw-*.log
# ArmorIQ-specific logs
tail -f /tmp/openclaw/openclaw-*.log | grep -E "ArmorIQ|armoriq|policy|Plan captured|verify-step"Key Log Messages
| Log Pattern | Meaning |
|---|---|
ArmorIQ SDK initialized | Plugin started successfully |
Capturing plan | LLM received prompt, creating tool plan |
Plan captured with N steps | LLM planned N tool actions |
Requesting intent token | Asking IAP for authorization |
Intent token issued | IAP authorized the plan |
verify-step request | Verifying a specific tool call |
verify-step result: allowed=true | Tool execution approved |
Testing via Telegram
Connect to Your Bot
- Open Telegram
- Search for your bot (e.g.,
@my_openclaw_bot) - Start a chat:
/start
Test Basic Functionality
Send a simple message:
Hello, what can you do?Expected: Bot responds with capabilities description.
Test Tool Execution
Send a prompt that requires tools:
Use web to find 3 Boston attractions and 2 restaurants.
Use web_fetch to open at least 2 sources.
Write a concise itinerary to aiqdemo/itinerary.md.
Then read that file and send me a 5-bullet summary.What Happens Behind the Scenes
When you send this prompt:
- ArmorIQ SDK initializes - Connects to IAP/backend
- Capturing plan - LLM reads prompt and decides tools
- Plan captured with 6 steps - LLM plans: web_search, web_fetch, write_file, read_file
- Requesting intent token - ArmorIQ asks IAP: "Can I execute this plan?"
- Intent token issued - IAP returns JWT with cryptographic proofs
- For each step:
verify-step request- ArmorIQ checks proof matches tool callverify-step result: allowed=true- Token + policy allows execution
- Tools execute - web_search runs, files written, etc.
- Response sent - Bot replies with summary
Test Policy Commands
List Policies
Send to your bot:
Policy listExpected response:
Policy version 1. No explicit rules. Default: allow all tools.Meaning: With no rules configured, all tools are allowed by default.
Create a Policy
Policy new: block upload_file for payment dataExpected response:
✅ Policy created: policy1
- Action: block
- Tool: upload_file
- Data: payment dataVerify Policy Enforcement
-
Create a blocking policy:
Policy new: block write_file for payment data -
Try to trigger it:
Write "credit_card=4111111111111111" to /tmp/test.txt -
Expected: Action should be blocked with policy violation message (detects PCI + PAYMENT data).
Reset Policies
Policy resetTest Scenarios
Scenario 1: Web Search + File Write
Search for the top 3 programming languages in 2026 and write a summary to /tmp/languages.mdWatch logs for:
Plan captured with 2 steps
verify-step request tool=web_search
verify-step result tool=web_search allowed=true
verify-step request tool=write_file
verify-step result tool=write_file allowed=trueScenario 2: Policy Blocking
# First, create blocking policy
Policy new: block all file operations
# Then try to write
Create a file test.txt with content "hello"Watch logs for:
verify-step result tool=write_file allowed=false reason=Policy blocks...Scenario 3: Multi-step Workflow
1. Search for Boston weather
2. Search for Boston events this weekend
3. Write a travel guide to aiqdemo/boston-guide.md
4. Read the file and summarize in 3 pointsWatch logs for:
Plan captured with 4+ steps- Multiple
verify-steprequests - All steps
allowed=true
Stopping the Gateway
If running in foreground
Press Ctrl+C
If running in background
# Find the process
ps aux | grep gateway
# Kill it
pkill -f "node.*gateway"
# Or by PID
kill <PID>Restart Gateway
pkill -f "node.*gateway"
sleep 2
node scripts/run-node.mjs --dev gateway &Log Analysis
Successful Flow
19:55:39 [plugins] armoriq: planning with model openai/gpt-4-turbo
19:55:57 Capturing plan: llm=openclaw, prompt=[Telegram user prompt...]
19:55:57 Plan captured with 6 steps
19:55:57 Requesting intent token for plan with 6 steps
19:56:05 Intent token issued: id=75357..., expires=60.0s, stepProofs=12
19:56:21 [plugins] armoriq: plan check (cached token) tool=web_search steps=6 status=ok
19:56:21 [plugins] armoriq: verify-step request tool=web_search proofs=present
19:56:22 [plugins] armoriq: verify-step result tool=web_search allowed=trueFailed Flow (0 Steps)
19:06:30 Capturing plan: llm=openclaw, prompt=[...]
19:06:30 Plan captured with 0 stepsCause: LLM didn't plan any tool actions. May need to rephrase prompt or check tool registration.
Policy Blocked
19:56:21 [plugins] armoriq: verify-step request tool=write_file
19:56:22 [plugins] armoriq: verify-step result tool=write_file allowed=false reason=Policy blocks write_fileCause: Active policy prevented the tool execution.
Quick Reference Commands
# Start gateway
cd /path/to/aiq-openclaw
node scripts/run-node.mjs --dev gateway &
# Watch logs
tail -f /tmp/openclaw/openclaw-*.log | grep -E "Plan captured|verify-step|allowed"
# Stop gateway
pkill -f "node.*gateway"
# Rebuild and restart
pnpm build && pkill -f "node.*gateway" && node scripts/run-node.mjs --dev gateway &Troubleshooting
Bot not responding
- Check gateway is running:
ps aux | grep gateway - Verify Telegram token in config
- Check logs for errors:
tail -50 /tmp/openclaw/openclaw-*.log
"Plan captured with 0 steps"
- LLM didn't plan tools - try rephrasing prompt
- Check model is set correctly (e.g.,
openai/gpt-4-turbo) - Verify API keys are valid
Policy commands not working
- Check
policyUpdateEnabled: true - Verify your user ID in
policyUpdateAllowList - Restart gateway after config changes
Tools blocked unexpectedly
- Run
Policy listto check active policies - Run
Policy resetto clear all policies - Check logs for specific block reason
Next Steps
✅ Gateway running and tested!
Proceed to Concepts to understand the architecture and verification flow in detail.