Skip to content

Interaction Modes

Reactive Agents supports 5 interaction modes that control how much autonomy an agent has.

ModeAutonomyDescription
AutonomousFullAgent acts independently
SupervisedHighPeriodic checkpoints for review
CollaborativeMediumBack-and-forth with the user
ConsultativeLowAsks before taking actions
InterrogativeMinimalGathers information only

Agents automatically escalate and de-escalate between modes based on:

  • Confidence — Low confidence triggers escalation
  • Cost — High-cost operations trigger supervision
  • User Activity — Active users trigger collaboration
  • Consecutive Approvals — Repeated approvals trigger de-escalation
Agent in Autonomous mode
-> Confidence drops below 0.3
-> Escalates to Supervised mode
-> User reviews and approves
-> After 3 consecutive approvals with confidence >= 0.9
-> De-escalates back to Autonomous

In supervised and collaborative modes, agents create checkpoints at key milestones:

// Checkpoints are created automatically during execution
// and can be resolved with user feedback

In collaborative mode, agents maintain structured conversation sessions with the user, tracking messages and question styles.

The interaction layer learns user preferences over time:

  • Tracks approval patterns
  • Builds auto-approve rules for common actions
  • Adjusts interruption tolerance

After sufficient confidence (>= 0.7) and occurrences (>= 3), certain actions can be auto-approved.

Approval gates let a human pause agent execution at critical decision points and decide whether to continue.

Calling approvalGate() suspends the currently running agent and waits for a human response:

import { InteractionManager } from "@reactive-agents/interaction";
import { Effect } from "effect";
const program = Effect.gen(function* () {
const interaction = yield* InteractionManager;
// Pause here — agent waits until a human responds
const approved = yield* interaction.approvalGate(taskId, "Deploy to production?");
if (approved) {
// Continue with the action
} else {
// Execution cancelled
}
});

Resuming from an approval gate:

// Approve — execution continues
await interaction.resolveApproval(taskId, true);
// Reject — execution is cancelled
await interaction.resolveApproval(taskId, false);

Timeout: If no response is received within 5 minutes, execution cancels automatically.

Individual steps within a WorkflowEngine workflow can also require approval:

const workflow = {
steps: [
{ id: "analyze", task: "Analyze the data" },
{
id: "deploy",
task: "Deploy the result",
requiresApproval: true, // Pause here for human sign-off
},
],
};

Resolve workflow step gates via OrchestrationService:

import { OrchestrationService } from "@reactive-agents/orchestration";
const orchestration = yield* OrchestrationService;
// Approve and let the step proceed
yield* orchestration.approveStep(workflowId, "deploy");
// Reject and cancel the step
yield* orchestration.rejectStep(workflowId, "deploy");
const agent = await ReactiveAgents.create()
.withInteraction() // Enable all 5 modes
.build();