Skip to main content
reopt Handbook
reopt Handbook
Enterprise Eve Agent Development

Core Architecture

Ch1. Eve Mental ModelCh2. Source Code AtlasCh3. Project Layout and DiscoveryCh4. Compiler and Runtime Graph

Agent Quality Design

Ch5. agent.ts, Models, CompactionCh6. Context, Skills, Dynamic CapabilitiesCh7. Tools, Approval, ConnectionsCh8. Sandbox Secure Runtime

Operational Runtime

Ch9. Channels, Auth, StreamingCh10. Subagents, Workflows, Remote AgentsCh11. Schedules, State, HooksCh12. Evals and Quality Gates

Production Operations

Ch13. Observability and DeploymentCh14. Enterprise PatternsCh15. Migration and Governance

Appendix

Official Docs CrosswalkVerification ReportUpdates
Handbook›엔터프라이즈 Eve 에이전트›Ch7. Tools, Approval, Connections
한국어English

Ch7. Tools, Approval, Connections

Design Eve authored tools, human approval, MCP/OpenAPI connections, and OAuth boundaries as enterprise security surfaces.

Key takeaways

  • Authored tool execute runs in the app runtime, not in the sandbox, so it is a privileged surface.
  • toModelOutput, needsApproval, and auth scope control data exposure and risky actions.
  • MCP/OpenAPI connections expand capabilities quickly, but require allow-lists, approval, and OAuth boundaries.

Tools are typed actions the model can request. The most important operational fact is that authored tool execute runs in the app runtime. If it can access secrets or internal APIs, treat it as privileged code.

Tool Structure

agent/tools/get_weather.ts
import { defineTool } from "eve/tools";
import { z } from "zod";

export default defineTool({
  description: "Return mock weather data for a city.",
  inputSchema: z.object({ city: z.string().min(1) }),
  async execute({ city }) {
    return { city, condition: "Sunny", temperatureF: 72 };
  },
});

Standards:

  • description is model-facing routing text
  • inputSchema is a control surface
  • execute must tolerate replay and retries
  • returned data may enter history and telemetry, so minimize it

Minimize Model-visible Output

Use toModelOutput when hooks/channels need rich output but the model should see only a summary.

toModelOutput(output) {
  return {
    type: "text",
    value: `Report ${output.id}: risk ${output.riskLevel}.`,
  };
}

This prevents CRM rows, audit payloads, pricing tables, and PII from being copied into later model context.

Approval Policy

HelperBehavior
never()no approval; omission has the same effect
once()approve first execution per session
always()approve every execution
predicatedecide from tool input
agent/tools/refund_charge.ts
import { defineTool } from "eve/tools";
import { always } from "eve/tools/approval";
import { z } from "zod";

export default defineTool({
  description: "Refund a customer charge.",
  inputSchema: z.object({
    chargeId: z.string(),
    amount: z.number().positive(),
  }),
  needsApproval: always(),
  async execute(input) {
    return refundCharge(input);
  },
});

Input-based Approval

needsApproval: ({ toolInput }) => {
  const amount = Number(toolInput?.amount ?? 0);
  return amount > 1000;
}

Keep business policy in pure functions under agent/lib/ and unit test it. Do not hide large policy logic inside tool definitions.

HITL Is Durable Parking

When approval is required, Eve emits input.requested and parks the session in session.waiting. The process is not held open. The session resumes when the answer arrives.

Connections

Connections expose external MCP or OpenAPI tools that you do not author.

ConnectionHelperModel-visible tool name
MCPdefineMcpClientConnectionconnection__<connection>__<tool>
OpenAPIdefineOpenAPIConnectionconnection__<connection>__<operationId>

The model discovers them through connection__search and calls qualified names.

agent/connections/linear.ts
import { defineMcpClientConnection } from "eve/connections";
import { once } from "eve/tools/approval";

export default defineMcpClientConnection({
  url: "https://mcp.linear.app/sse",
  description: "Linear workspace: issues, projects, cycles, and comments.",
  auth: {
    getToken: async () => ({ token: process.env.LINEAR_API_TOKEN! }),
  },
  tools: { allow: ["search_issues", "get_issue"] },
  approval: once(),
});

Tokens Stay Out Of The Model

Connection tokens are resolved in the app runtime and injected into outbound requests. They do not become model context. This is a major safety property, but scope still matters.

RiskResponse
shared app token reaches all tenant datause user or tenant-scoped token
too many MCP tools exposeduse allow-list
write operation has no approvalsplit tools or use approval: always()
token revoked mid-callmap provider 401 to ctx.requireAuth()

Tool Auth vs Connection Auth vs Route Auth

SurfacePurpose
route authwho may call Eve routes
tool authone custom tool needs OAuth
connection authan external MCP/OpenAPI server needs credentials

Route auth does not automatically make tool or connection scopes safe.

ask_question vs Approval

PurposeEve feature
permission to executeneedsApproval
missing informationbuilt-in ask_question
OAuth consenttool or connection auth

All use the same durable input.requested pause protocol, but their intent is different.

Tool Design Checklist

ItemStandard
input schemastrict validation and limits
output minimizationmodel sees only what it needs
idempotencyexternal writes use key or ledger
approvalirreversible/sensitive actions gated
authtoken scope and principal type explicit
observabilityaction.result hook can audit
evalcalledTool/noFailedActions/output checks

Related docs

Ch15. Migration and Governance

Migrate existing agents into Eve and establish enterprise governance for agent portfolios.

Ch1. Eve Mental Model

Understand Eve as filesystem authoring, durable workflow execution, runtime harness, and channel protocol.

MCP Integration

Advanced Codex Usage · Connect Codex to MCP servers with explicit tool, data, and trust boundaries.

API Docs and Specs

Agentic Documentation · Connect OpenAPI 3.2, tool schemas, MCP Resources, and contract tests.

MCP connections and commands

Claude Code Command Master · Choose the commands for mcp connections and commands and follow their availability rules and concrete examples.

Ch6. Context, Skills, Dynamic Capabilities

Design context, skills, dynamic tools, dynamic instructions, and dynamic skills for high-quality Eve agents.

Ch8. Sandbox Secure Runtime

Turn Eve sandbox trust boundaries, backends, network policy, credential brokering, and workspace lifecycle into operating standards.

On this page

Tool StructureMinimize Model-visible OutputApproval PolicyInput-based ApprovalHITL Is Durable ParkingConnectionsTokens Stay Out Of The ModelTool Auth vs Connection Auth vs Route Authask_question vs ApprovalTool Design Checklist