Samples

Sample agents

Each sample is a DAK stack you can copy, synth and deploy to your own workspace. Your Dezifi contact can share the sample folder with you.

The samples

SampleWhat it shows
Support agent (the Acme Analytics showcase)A support agent embedded in a SaaS product: help-centre answers with citations, account lookups and refund requests on the product's own API as the signed-in user, every refund held for approval, a workspace guardrail baseline plus an agent profile, a signed-in-only widget with a server token route, and two gated evals. Java.
Ops triage (ops-triage)An internal agent on Linear: searches and reads run at once, creating or updating an issue waits for an owner or admin to approve. Injection checks on messages and on what Linear returns. A secret key scoped to this agent only. TypeScript.
Document Q&A (docs-qa)A knowledge-base agent that cites the document it used and says when the documents do not cover a question; grounding guardrail; per-end-user daily spend cap; signed-in-only widget plus the secret key your server mints tokens with; a golden dataset whose gate is the quality bar. TypeScript.

Run one

terminal
cd portal/samples/beta-agents/docs-qa
npm install
npx tsc --noEmit            # type-check first: tsx runs the app without checking types
npx dak synth               # writes dak.out/ (no network, no key needed)

export DEZIFI_SECRET_KEY=sk_dezifi_...   # deploy key
export DEZIFI_WORKSPACE_ID=<workspace id>
export OPENAI_API_KEY=sk-...             # read on your machine at deploy time, never written to dak.out/
npx dak deploy --json > deploy.json      # contains a one-time key: keep this file private, then delete it

# Load the documents (after choosing the knowledge base's indexing key, see the Knowledge base guide):
DATASET_ID=$(jq -r '.[0].resources[] | select(.logicalName == "Docs") | .physicalId' deploy.json)
for f in docs/*.md; do npx dak rag ingest "$DATASET_ID" "$f"; done
Set the workspace in dak.json (or DEZIFI_WORKSPACE_ID). The ops-triage sample also needs LINEAR_API_KEY. Both TypeScript samples were type-checked and synthesized with the SDK version this guide targets.

Adapting them

  • Change names, instructions and models first; synth again and compare dak.out/ to see what changed.
  • Keep secrets as SecretValue.envVar(...): the CLI resolves them on your machine at deploy time and nothing secret is written to dak.out/.
  • Policies name catalog tools as integration:action (linear:create_issue) and your own API tools as custom_<toolName>.
  • Put each copy of a pattern in its own Stack: logical ids must be unique within a stack.