Integrations
Anthropic / Claude
✓ Certifiednpm: @loop-engine/adapter-anthropicProvider: Anthropic
What it does
@loop-engine/adapter-anthropic wraps the Anthropic Messages API as a Loop Engine AI actor. The adapter calls Claude with loop context, parses the structured response, and returns an AIAgentActor plus AIActorDecision ready for runtime submission. Guards run after the adapter returns — Claude cannot bypass them.
Quick setup
-
Install
1npm install @loop-engine/adapter-anthropic2npm install @anthropic-ai/sdk -
Create the actor
1import { createAnthropicActorAdapter } from "@loop-engine/adapter-anthropic";23const adapter = createAnthropicActorAdapter(process.env.ANTHROPIC_API_KEY!, {4 modelId: "claude-opus-4-6",5 confidenceThreshold: 0.756}); -
Submit to a loop transition
1const { actor, decision } = await adapter.createSubmission({2 loopId: "procurement",3 loopName: "SCM Procurement",4 currentState: "pending_analysis",5 availableSignals: [6 {7 signalId: "submit_recommendation",8 name: "Submit Recommendation",9 allowedActors: ["ai-agent"]10 }11 ],12 instruction: "Analyze demand data and recommend a purchase order.",13 evidence: { demandForecast: 0.91, currentStock: 38 }14});1516await loopSystem.transition({17 aggregateId: "procurement-1",18 signal: decision.signalId,19 actor,20 evidence: decision21});
How it works
- Builds a structured prompt from
LoopActorPromptContext - Calls
client.messages.create(...)with loop context - Parses JSON and validates
signalId+confidence - Computes SHA-256
promptHash - Returns
AIAgentActor(provider: "anthropic") +AIActorDecision - Caller submits to runtime and guards evaluate after submission
Configuration reference
| Option | Type | Default | Description |
|---|---|---|---|
| modelId | string | claude-opus-4-6 | Anthropic model ID |
| maxTokens | number | 1024 | Max tokens in response |
| | | — | Optional system prompt prepended to loop context |
| | | | Minimum confidence required (0–1) |