Quickstart

Quickstart

Two minutes from here to a real decision flowing through Eda. You’ll install the SDK, wire one eda.check(), and watch the action land in your audit log.

Prefer to let AI do it? Skip to eda init — the CLI scans your repo, finds the risky calls, and writes the gates for you. Or press ⌘K and ask Gideon to tailor these steps to your framework.

Get an API key

Create a workspace and mint a key (shown once) in the dashboard.

Keys look like eda_live_… (production) or eda_test_… (sandbox). Put it in your environment — never in source control:

echo 'EDA_API_KEY=eda_live_xxx' >> .env.local

Install the SDK

The SDK is zero-dependency and runs anywhere JavaScript does — Node ≥ 18, edge runtimes, Deno, Bun, and the browser.

bash npm install @eda-holding-inc/sdk

Gate your first action

Find the line where your agent does something consequential and put a check in front of it.

refund.ts
import { Eda } from "@eda-holding-inc/sdk";
 
const eda = new Eda({ apiKey: process.env.EDA_API_KEY! });
 
export async function refundCustomer(customerId: string, amount: number) {
  const decision = await eda.check({
    agent: "support-agent",
    action: "refund_customer",
    params: { customerId, amount },
  });
 
  if (decision.status !== "approved") {
    // blocked by policy, or a human hasn't approved yet
    throw new Error(`Refund not allowed: ${decision.reason}`);
  }
 
  // Safe to perform the real side effect now.
  return stripe.refunds.create({ charge: chargeFor(customerId), amount });
}

That’s the whole pattern: check → branch on decision.status → act only when approved.

Run it and watch the log

Call your function. Every check — allowed or blocked — appears live in the activity feed with the agent, action, parameters, decision, and the policy that matched.

Add a policy (make it interesting)

By default, with no matching policy, Eda allows and logs. Now add a rule so large refunds require a human. In the dashboard → Policies → New policy:

  • Agent * · Action refund_customer
  • Condition amount > 500
  • Effect require_approval

Re-run with amount: 900 and the decision comes back pending. Approve it in the dashboard and your waiting code resumes — see the next step.

(Optional) Wait for the human inline

When an action may require approval, let the SDK block until a human decides:

const decision = await eda.checkAndWait(
  { agent: "support-agent", action: "refund_customer", params: { amount: 900 } },
  { timeoutMs: 5 * 60_000 }, // give the approver 5 minutes
);
 
if (decision.status === "approved") {
  await stripe.refunds.create({ /* … */ });
}

You’re gated. What next?