Skip to main content

Overview

Tool Name

Purpose

The apps_tools (also called GenesisApps) let agents create, deploy, and manage lightweight web applications that run inside the Genesis platform, including migrated Workshop projects built with Databricks AppKit. These apps are accessible to users via the Apps panel in the Genesis UI — no external hosting, Docker knowledge, or DevOps pipeline required. GenesisApps are ideal for turning one-off analyses into living, shareable deliverables: interactive dashboards, operational CRUD tools, and narrated slide decks.

Key Features

Scaffold from Templates

Instantly generate a working application skeleton using built-in templates for Dash dashboards, Flask apps, presentation decks, or migrated Workshop AppKit projects.

Full Lifecycle Management

Create → Scaffold → Write Files → Start → Verify → Capture Screenshot → Review → Stop — all from chat.

Reverse-Proxy Serving

Each app is served through Genesis’s reverse proxy at /api/apps/<app_id>/proxy/, with automatic port management and base-path injection. On Genesis Desktop, Python app servers also reject direct requests to their loopback ports; see the proxy behavior reference. That reference also covers runtime recovery rules.

Dataset Integration

Dash dashboards connect to data via the Datasets fast layer — cached SQLite snapshots that avoid hitting your warehouse on every page load.

Access Control

Grant view, edit, or manage privileges to roles and individual users. Publish or keep apps in draft mode.

Branding

Apps inherit organization branding (logos, colors, design guidance) automatically from genesis_branding.json.

Chat Embedding

Embed any running app directly in a chat message with ```app my-app-id```.

Architecture

Python GenesisApps are standard Dash or Flask web applications running in their own subprocess. Migrated Workshop AppKit projects use a Node.js runtime; see AppKit runtime requirements. Genesis manages: On Linux, unconfined app processes run under per-run cleanup. STOP and RESTART stop processes the app started, including detached descendants. If the Genesis server exits unexpectedly, an app’s reaper detects the parent exit and starts cleanup. Dashboard render workers and dependency-installation commands also stop processes they started when the operation completes or times out. When a versioned app’s runtime moves to separate storage, Genesis removes its obsolete copy under bot_storage during cleanup passes, unless that storage is stage-backed. These passes run at startup and hourly by default, with no setting to enable; active or otherwise referenced runtime paths are left alone.
Python GenesisApps do not have direct database credentials; their data access uses the Genesis API layer. AppKit projects use a configured Databricks connection for runtime setup; see AppKit runtime requirements.
Before a Genesis-runtime app starts, Genesis checks the app’s source and bound datasets for Databricks reads of Prover scratch schemas, following views as well as direct queries. A start is refused if a source reads a scratch schema or the check cannot finish; a proof copy may read its own scratch schema. Connections, datasets, or schemas the creator cannot read are reported as unchecked rather than read. This blocking preflight can take up to about 60 seconds, plus an in-flight request timeout. Genesis also runs an auxiliary LLM security review on selected WRITE_FILE / WRITE_FILES payloads before they are saved — for example Python that may probe the host filesystem, launch subprocesses, or reach outside documented Genesis API usage. When that review cannot run because the active chat provider is misconfigured, unreachable, or returns an empty response, Genesis blocks the write with success: false, error: "GenesisApp security review is unavailable; blocking file.", and a security_findings entry with rule_id: "llm_app_code_guard" and severity: "block". The finding message includes the failure kind (not_configured, provider_exception, or empty_response). Fix the provider in Config → AI Providers and retry the write rather than treating the failure as a policy denial on the code itself.

Functions Available

apps_action

The primary function for all GenesisApp operations. Dispatches based on the action parameter.

Actions Reference

After a START or RESTART crashes, Genesis refuses another start of the same runtime slot for 30 seconds rather than launching it again. The refusal includes retry_after_seconds and a hint to read LOGS(since_last_start=true) and fix the crash before retrying. A successful start clears the cooldown; it is process-local and a server restart forgets it.

Export an app as a video

Use EXPORT_VIDEO to film a running app page frame by frame and write an MP4 (H.264 video with Opus audio). Set url_suffix to the page path and query parameters under the app, such as prover/?clean=1; it cannot be a URL or contain ... The app must answer the preflight check before rendering starts. The export runs in the background: keep the returned export_id to read progress with EXPORT_VIDEO_STATUS, or wait for the completion notice in the current thread, which includes the output file’s git_url when available. video accepts duration_seconds (required, maximum 300), fps (default 30, maximum 60), resolution (1080p by default or 720p), optional share_copy_720p, file_name, and frame_source (auto by default, canvas, or page). Frames use the page’s window.renderFrame(t) or window.seek(t) when available; otherwise Genesis captures screenshots on a stepped clock. Optional audio_clips is a list of {app_id, path, start_seconds} entries; app_id defaults to the filmed app. Each clip must be an MP3, WAV, M4A, AAC, OGG, Opus, or FLAC file no larger than 25 MiB in an app workspace the caller may read. Before rendering, the call reads each clip and makes one HTTP preflight request to the app (up to 10 seconds; on Genesis Desktop the first call can also wait up to 150 seconds for browser tools to download). For a working copy of a versioned app, set run_source="working_copy".
For the apps_action audit trail, see the Admin Audit Log. URL and app results that provide links return primary_human_url for the Apps Library page a person should open, authenticated_proxy_url for an already signed-in Genesis session, and link_guidance explaining which link to use. URL also returns internal_service_url for requests made from the Genesis host. The legacy url and proxy_url fields remain aliases of internal_service_url; do not share those as the human-facing link. READ_FILE returns the file’s sha256 alongside its content. For SEARCH_REPLACE and WRITE_FILE, pass that value as expected_sha256 to make the edit conditional on the file still matching the version you read. On a hash mismatch, Genesis rejects the edit without writing and returns error_code: "STALE_EDIT", the current hash, and a corrected example_call; read the file again and reapply the change. If the file no longer exists, current_sha256 is null and the response explains how to retry. Successful edits return sha256 for the resulting file, and SEARCH_REPLACE also returns previous_sha256. Edits to the same file are serialized, so parallel writes do not silently overwrite one another.
START returns start_outcome so callers can distinguish a transition this call performed from a live runtime it found and left in place. A new start returns {"started": true, "reason": "started"}. When the runtime was already running or starting, the response returns started: false, the reason, running_since when available, code_reloaded: false, and restart_with. restart_with names the literal call the caller that received it can make — an apps_action(...) invocation for the tool, an HTTP endpoint for the REST route. START does not reload app.py or requirements.txt on that reuse path; use RESTART, or the call named by restart_with, when the code must be reloaded.
apps_action(action="LIST") returns success: true with an apps array. Each entry is the same status-shaped payload as STATUS when lookup succeeds. When status lookup fails for one app (for example a legacy non-canonical registry key or a corrupted workspace record), that entry is still included with status: "unknown" and an error string so the rest of the list remains usable. Inspect error and call STATUS or EXPLAIN_BLOCKING on the affected app_id before mutating it.Genesis stores app_id in canonical form: lowercase letters, numbers, and hyphens, 1–64 characters, starting and ending with a letter or digit. On registry load, legacy keys that differ only by casing or punctuation are renormalized to the canonical id; duplicates after renormalization are skipped.
Registry changes from CREATE, DELETE, replace_existing, and app metadata updates take effect only after the app registry is saved. If that save is unavailable during replacement or DELETE, the tool returns success: false, error_code: "app.registry_unavailable", and retryable: true; retry the operation later. A refused replacement leaves the existing app registered. For metadata changes, a refused save reports failure and leaves the previous metadata in place. After CREATE, saving the requested or derived display name is best-effort: if that separate save is refused, the app remains created with its previous name.

presentation_deck_generate_tts

Generate MP3 narration audio for a running presentation deck app with Genesis’s speech provider. When Genesis AI is the chat provider, narration uses Genesis AI; otherwise Genesis tries an admitted OpenAI key, then the LiteLLM proxy, then Genesis AI. Genesis AI uses its speech alias, so narration does not need an OpenAI key. When no cloud provider can speak, or the provider refuses or cannot be reached, the built-in local voice (Kokoro-82M, below) speaks instead while text_to_speech.fallback_to_local is on. Each generated clip reports the engine that spoke it (openai, litellm_proxy, genesis_ai or local) and the engine_voice it used; the result lists engines_used and, when the local voice stood in, fallback_reason. Pass provider="local" to always use the local voice. Deck playback caches a fetched, versioned audio take privately in the browser for 30 days; re-recording a clip changes its URL so playback fetches the new take. The player uses video-style icon buttons for Previous slide, Play or Stop, Next slide, Sound On / Sound Off, and Captions On / Captions Off. The sound and captions controls are on by default and reset to on when the deck is opened again. Captions appear during narration even when sound is on; their band stays reserved when captions are hidden, so the slide does not move. Captions follow the clip’s playback position, and the deck advances when the clip ends. The controls retain their accessible button names, and the player repositions controls and captions on narrow or short screens to keep them from overlapping. The player buffers the starting narration while the title screen is shown, so it can begin as soon as the viewer presses Play. On an upright phone, canvas slides use the full screen width with larger captions below; the player suggests rotating the phone and offers a full-screen landscape lock when the browser supports it. On iPhone, narration continues while the controls are hidden; tap the slide to reveal them without triggering a control. The slide refits when the viewport changes, including after rotation. When maximized on a wide screen or in landscape, the slide fills the viewport and the captions and playback controls overlay its lower edge; on an upright phone, captions remain below the slide. The player respects the device’s safe-area insets, and its controls can fade while playing and return on interaction. Narration runs in the background, because a whole deck can take longer than a tool call may wait (a 9-slide deck in the local voice takes over a minute, past the 60 seconds an MCP gateway waits):
  • Whole deck: the call returns at once with a job_id, status: "running" and clips_total. The thread that asked is woken when the job ends, with the same per-clip result the call used to return (generated, each clip’s engine, voice and duration_seconds, fallback_reason, errors and hints), and the deck’s presentation_audio/tts-metadata.json is written as before. End the turn and wait for the wake; do not call again.
  • Selected slides (slides=[...]): the call waits up to 30 seconds and returns the result inline when the job ends in time, as most single-slide or single-stage regenerations do, so fixing one slide stays a one-call step. A longer one returns its job_id like a whole deck.
  • Reading a job: presentation_deck_generate_tts(app_id=..., job_id=...) returns progress (clips_done of clips_total) while it runs and the result once it has finished. A caller outside Genesis (an MCP client) has no thread to wake and reads the job this way.
  • One job per deck: a second request for a deck that is still being narrated is refused with the running job’s id; nothing new starts. At most three decks are narrated at once on a server; a request beyond that is refused until one finishes. Jobs are kept in the server’s memory, so after a restart read tts-metadata.json or run apps_action REVIEW.
Use use_genesis=true (default) to rely on the platform speech provider. Pass provider="openai" to request OpenAI without switching to another paid provider if it refuses; when api_key is supplied for that request, the deck calls OpenAI directly with that key, otherwise Genesis uses its configured OpenAI key and the configured local voice may stand in if the cloud request fails. provider="local" always requests Genesis’s built-in local voice. With provider="auto", an api_key is a direct OpenAI fallback if Genesis speech fails. api_key accepts a raw OpenAI key or a stored secret_* reference. See the full parameter reference below for format, slides, voice_match, use_genesis, and timeout_seconds.
Narration is read only from the canonical n field in presentation_deck.json. If a slide uses alias keys such as narration, speaker_notes, notes, voiceover, or script without n, TTS skips that slide and validation reports a warning. If no selected slides contain n, presentation_deck_generate_tts returns success=false with diagnostic hints instead of generating empty output.Each generated clip reports its narration word count (words) and, for MP3, duration_seconds; the same values are included when an existing clip is kept. REVIEW warns when a slide or build step plays without narration, when a clip’s recorded narration no longer matches its current n text, or when presentation_audio/tts-metadata.json is unreadable and freshness cannot be checked. After narration generation, run apps_action(action="REVIEW", app_id="<app_id>") again to confirm every clip is present and current before handing over the deck. Add narration to n or regenerate the affected clip with presentation_deck_generate_tts(slides=[...], overwrite=true).

text_to_speech

Turn narration text into MP3 or WAV clips saved in the conversation’s files, without a GenesisApp. Pass text for one clip or lines for one clip per line (up to 60), for example one per beat of an explainer video. Each clip reports its git_url, duration_seconds, words, the engine that spoke it and the voice. Local, offline voice. Genesis includes an open-source speech engine, Kokoro-82M (Apache-2.0), run on the server’s CPU with onnxruntime. It needs no internet and no OpenAI and costs nothing per call. When the configured cloud provider is missing or fails, the tool falls back to it (text_to_speech.fallback_to_local) and says so in fallback_reason. That setting defaults to true; set it to false to report the cloud error instead. English only. The same fallback applies to POST /api/tts/speech and to presentation deck narration. The local voice bundle (model, 27 English voices and pronunciation dictionaries) is about 350 MB and is not in the image. By default it is downloaded once, on first use, into <storage>/models/kokoro-82m-v1.0, every file checked against a pinned SHA-256. For an air-gapped server, fetch it on a Genesis checkout where internet is allowed:
copy the folder it names to the server (into the same place in its storage, or anywhere with text_to_speech.local_bundle_dir pointing at it) and turn text_to_speech.local_allow_download off. Genesis never downloads into a configured folder, and synthesis never uses the network. The local voice pronounces words from dictionaries and spells out numbers, money and years. It also uses nearby words to choose readings for common words such as bow, wind, read, live, close, tear, and use. A sentence-opening A used as an article (for example, A plan) is spoken as “uh”; uses as the letter (such as Plan A or A/B) keep the letter reading. An unusual name can be pinned with inline phonemes; the tool’s manual (get_tool_manual=True) shows the syntax. In presentation-deck narration, the local voice speaks a pinned word using its phonemes, while captions, transcripts and speaker notes show the word; cloud speech providers receive the word without the pin markup. Speech is AI-generated: disclose it when publishing, and have a person listen to the final audio. To check pronunciation without making audio, call text_to_speech(lines=["Quarterly results are ready."], preview_pronunciation=true). The preview runs the local voice’s text-to-phoneme step offline, with no audio, paid synthesis, or network call. It reads the local pronunciation dictionaries (about 6 MB on first use; if missing, the result explains how to install them) and returns each line’s phonemes plus flags for unusual dictionary words, heteronyms, acronyms, numbers, and pronunciation pins. Reword a flagged phrase or pin its intended sound inline, then preview again; pins affect only local speech, not captions or cloud voices.

explainer_video_action

Make and check a narrated explainer film from an explainer_video GenesisApp (scaffolded with template="explainer_video"). The explainer-video agent skill walks through the whole workflow with a person approving each step; see Explainer Videos. Storyboards can use a style’s preset scenes or compose beats made from general elements such as paths, icons, timelines and callouts; a compose beat can be rendered in either style. The optional top-level brand field defaults to false; set it to true to use the house brand pieces, including the orb’s face and the G mark in the orb style. See the scaffolded app’s STORYBOARD_SCHEMA.md for compose element fields and preset options. Compose elements can use start: "word:<word>" to time a drawing to a word in its beat’s narration, and copies (2–40) to draw a placed element repeatedly in a grid. Figures support pose: "hold" and pose: "sleep" in addition to the existing poses; hold reaches a hand out for an icon or other element, and sleep closes the eyes and shows idle sleep marks. A character gets a stick body with body: true; see the app’s STORYBOARD_SCHEMA.md for the hand placement. An optional positive number of seconds in storyboard.json’s target_seconds field gives the planned film length; if omitted, the estimate uses 60 seconds. It does not change timing. CHECK_PREREQUISITES, NARRATE, and STILLS report a length estimate per beat and in total, including each beat’s seconds, word count, and timed_from value (clip for a measured clip, otherwise words). When the estimate is well over its target or a short script is spread across too many beats, it also reports a plain-language warning (also surfaced as the first hints entry) with suggestions for cutting seconds, words, or beats. When target_seconds is set, the estimate also reports over_target_seconds and a summary suggesting how much text to cut. When an image model is configured, CHECK_PREREQUISITES and STILLS also report the film’s main-subject picture plan. The pictures.next_step and top-level next_step name 2–4 pictures to create with GENERATE_ASSET; until those pictures are used in the film, craft cannot be rich and look.done remains false. Without an image model, generated pictures are optional. STILLS includes the outstanding picture requirement in craft.next_step, so address it before rendering. With motion=true, STILLS also returns motion_strips: per beat and aspect, three moments showing the camera move into the beat (or halfway through a dissolve out of a recap), the hand drawing, and the finished frame. Its craft.near_edge findings name words still within 4% of the frame edge; move or shorten them before rendering. GENERATE_ASSET and IMPORT_ASSET report usable, a one-sentence verdict, and quality (problems, warnings, pieces, ink_share, shaded_share, off_palette_share), plus a cleaned list of what was removed. Cleaning can remove specks, pale patches, stray ground lines or shadows, and trim a ground line that sticks out from the subject. An unusable image is still saved for inspection, but should not be placed in a beat. For generated images, paid_requests reports how many paid image requests the call used; if it is unusable, change the prompt rather than repeating it unchanged. NARRATE makes one speech request per new or changed line (or uses local CPU synthesis); STILLS opens the app in the server’s browser and uploads PNGs; RENDER encodes films in the background; and QA reads and decodes the films, checks text with OCR when available, and may use the video_transcript tool if registered. Render records are kept in server memory; after a server restart, render again before checking the films with QA. CHECK_PREREQUISITES, STILLS, RENDER and QA report engine_outdated with an upgrade_engine SCAFFOLD call when the app’s copied engine is older than the template, even if the other checks pass. They also report this when engine files cannot be checked. Run the returned apps_action(action="SCAFFOLD", app_id=..., template="explainer_video") call for that app before rendering, then restart it if it is running. This refreshes the engine while keeping storyboard.json, narration and pictures. Edited engine files are listed in files_kept_edited; pass overwrite=true only when those edits should be replaced too. GENERATE_ASSET makes one paid image request (occasionally a second if the provider refuses a transparent background); IMPORT_ASSET reads an image, at most 25 MiB. Both write a PNG inside the app, and replacing an asset restarts the app if it is running. Use the asset in a compose beat with an image element, then inspect it with STILLS. ICONS returns names for icon elements; it does not read or write image files. For a migrated Workshop app with queued notifications, Databricks DEPLOY returns config.notification_delivery_job with the owned job’s ID and status. It creates that job paused, preserves an existing one on later deploys, and removes it when the app is undeployed; its empty smtp_secret_scope parameter must be set and its schedule unpaused by a person before e-mail sends. See the Foundry migration guide for delivery timing and setup. For example, check the app, add narration, inspect the stills, then start the render:
The tool never publishes anything: it writes files to the conversation. When handing over a film, say the voice is AI-generated and which engine spoke it. A person must watch and listen to every final cut, since QA cannot judge motion, voice or music.

Scaffold Templates

Call apps_action(action="TEMPLATES") to see the latest list. Built-in templates:
Best for: Interactive data dashboards with Plotly charts and AG Grid tables.Generates: app.py, requirements.txt, assets/style.cssIncludes server-side Dash callbacks, null-safe filter patterns, Genesis API integration, and CSS styling. KPI cards are data-driven from the bound dataset (row count plus column-derived totals or distinct counts) rather than hardcoded demo labels. This is the recommended default for dashboard-style apps.Aliases: dash_dashboard
Best for: Comparing performance of direct /api/query calls vs. the Datasets fast layer.Generates: app.py, requirements.txt, assets/style.cssMeasures and displays latency benchmarks so you can validate the Datasets caching benefit.Aliases: dash_dataset_benchmark
Best for: Operational CRUD applications — forms, tables, import/export workflows.Generates: app.py, requirements.txt, static/style.css, templates/*.htmlLocal-first design with SQLite under MICROAPP_STATE_DIR for persistent state. Includes a connectivity check endpoint but no data sync by default.Aliases: flask_ops_crud, flask_enhancement_inbox
Best for: Minimal starting point for custom Flask apps.Generates: app.py, requirements.txt, static/style.cssPrefix-safe with /healthz endpoint. Includes genesis_llm_call(...) and genesis_llm_direct(...) helpers for server-side app LLM calls. Add your own routes as needed.
Best for: Rebuilding a Palantir Foundry Workshop app as a GenesisApp from the compiled migration spec.Generates app.py, requirements.txt, static/style.css, static/blueprint-icons.json, and all files under static/vendor/ (including the browser libraries and their licenses). The icon asset supports Blueprint icons in the migrated page. Object-list property columns and layouts, supported widgets, search-bar and chart-label behavior, map legends, and map tile-source details are covered in Migrating and proving a Workshop app. The template also supports Workshop link buttons wired to a variable: absolute http and https URLs open in a new tab, and clipboard buttons copy the variable’s string, number, or boolean value. Fixed-address links and other URL schemes are not opened; when a value is missing, unreadable, or refused, the button reports that instead.Re-running SCAFFOLD refreshes recorded template files that have not changed since Genesis wrote them when the template has since changed, and keeps edited files. The result reports these as files_refreshed and files_skipped. For an older app without file records, explicitly refresh app.py with files=[{"path": "app.py"}] and overwrite=true only after verifying it is unchanged template code.For this template, behind_template lists kept files that differ from the current template, and warning names them and explains the refresh path. Preserve app-specific edits before using overwrite=true; it replaces generated files too, including query files, logic bindings, and ported logic. tables_without_declared_types and spec_warning identify object tables whose older spec lacks declared column types; recompile the spec, copy it to workshop_app_spec.json, and scaffold again. See the Workshop migration guide.AppKit’s analytics plugin is off by default. To opt in, set "analytics_plugin": {"enabled": true} in workshop_app_config.json and run SCAFFOLD again. The generated config/workshop/analytics.json lists the only eligible single-row scalar values and fixed-choice page-input queries the plugin may serve; other reads stay on the Workshop routes. The guard binds request parameters to declared choices and scopes the cached result to the viewer. WORKSHOP_ANALYTICS_PLUGIN set to 0, false, off, or no can disable it, but cannot enable it; it is also disabled inside Genesis and in development. When an optional feature is off, its GET routes answer 404 instead of falling through to the page; action-form code is loaded only for an app that has actions. On the first SCAFFOLD into a fresh workspace with a spec, Genesis also leaves out the template files and client chunks for unused actions, notifications, and saved states. Later scaffolds and workspaces that already contain app files use the full template. The AppKit project README in the scaffolded app describes the allowlist and guard.SCAFFOLD also generates server/workshop/spec.generated.ts from the app spec. It exports WidgetId, ValueId, ParameterName, ParameterValues, ActionId, and ActionBodies, alongside the spec tables and the parameterProblems and actionBodyProblems request-check helpers. The generated module is included in the app’s TypeScript check; GET routes use the parameter checker when their runtime spec digest matches. A malformed parameter the runtime actually reads (not an unknown query name, viewer attribute, or inactive tab value) receives a neutral 400 on the page, /workshop-values, /workshop-page, /workshop-table, and /workshop-actions, but only where the read did not already refuse the viewer. The generated AppKit form also checks its values as the viewer edits them: POST /actions/<id>/check accepts the action’s parameters and trigger, returns field errors and failed form-only submission criteria, and runs or saves nothing. Submit stays disabled while a check is pending or reports a problem; field errors appear beside changed fields, and criteria or errors without a visible field appear above the buttons. A check that fails or times out does not disable Submit; the save still checks again. Criteria that need the edited object’s row or the person’s groups, and choice lists read from a query file, remain for the save to check. The check uses the same viewer refusals as /workshop-actions, returns 404 for an unknown action or trigger, and is limited to 40 checks per viewer in 10 seconds (429 after that). If the generated module is missing or its digest does not match the app spec, parameter checks take requests as before and log once that checks are off.
Best for: Narrated slide presentations with splash screens, transitions, and optional AI voice-over.Generates: app.py, requirements.txt, presentation_deck.json, presentation.js, presentation_styles.css, slide generators under presentation_slides/, and example images under presentation_images/.A stdlib-only HTTP server (no Dash/Flask) that renders slides from a JSON definition. app.py loads the scaffolded presentation.js and presentation_styles.css runtime assets; edit those files with WRITE_FILE when you need custom deck chrome or client behavior. Supports OpenAI TTS narration via presentation_deck_generate_tts.Aliases: presentation, deck
Best for: Short narrated explainer videos about any topic (whiteboard or orb style) rendered to a 16:9 MP4, with a vertical 9:16 cut and a 720p copy on request.Generates: app.py, index.html, player.css, storyboard.json, storyboard.py, STORYBOARD_SCHEMA.md, the film engine and its icon set under engine/, the style packs under styles/, fonts under fonts/ and sample storyboards under samples/.A stdlib-only server that plays storyboard.json as an animated film with a preview (play, scrub, 16:9 / 9:16). Edit the storyboard, not the engine; use explainer_video_action to narrate, render and check it. See Explainer Videos.Aliases: explainer, video_explainer, explainer_film

AppKit project tests

The generated foundry_workshop_appkit project requires Node 22.18 or later. From its root, a clean build runs npm ci, npm run typecheck, npm run lint, npm test, and npm run build. The Node test suite checks the generated query manifest and server routes with a stub warehouse; it needs no Databricks credentials or network access. Genesis START runs its AppKit typecheck, lint, and smoke checks, but does not run npm test.

Typical Workflow

Building a Dashboard

1

Create the app

2

Scaffold the template

If you already have a dataset, SCAFFOLD can bind it immediately with dataset_id="sales_dashboard_data". That writes genesis_datasets.json using default read + ssrm actions unless you override them with dataset_actions. Use DATASETS_SETUP instead when Genesis still needs to create or refresh the dataset first.
3

Set up datasets (recommended)

This creates the dataset, refreshes it, writes genesis_datasets.json, and restarts the app.To bind existing datasets without creating new ones, call:
The binding shortcut writes genesis_datasets.json, preserves the existing datasets, and restarts the app. You can also put actions inside the shortcut payload; when omitted, Genesis defaults to both read and ssrm.Use kind="materialized_dataset" for larger single-source dashboard snapshots. query_cache_dataset is capped at max_rows <= 10000; if you stay on that lightweight cache path, reduce the cached result with filters or aggregation first.
4

Customize app.py

Edit the SQL queries, chart definitions, and layout. Use WRITE_FILE for a single full app.py replacement, and WRITE_FILES when updating app.py plus requirements or assets in one batch.
5

Record dashboard attestation

New dashboard scaffolds can require typed proof before the first review and start sequence can complete.
6

Clear the first-start review gate

REVIEW runs health checks, captures a screenshot, tails logs, reports diagnostic hints, and can pass even before the first runtime is started so the initial dashboard gate can clear.
7

Start or restart the runtime

Use RESTART after later code or dependency changes. Add auto_capture_after_start=true when you want START to return screenshot/render diagnostics immediately.
8

Self-audit before sharing

Compare the rendered dashboard against the original request or REQUIREMENTS.md. Confirm that required KPIs, filters, grid columns, chart labels, units, and time ranges are present and plausible. If gaps remain, update the app, RESTART, and re-run the audit. Limit this loop to 3 audit cycles; if gaps still remain, call them out explicitly in the handoff instead of treating the dashboard as complete.
9

Publish and share

The final dashboard handoff should include the self-audit gap list, the deployed URL, the runtime env vars used (at minimum GENESIS_API_BASE_URL and GENESIS_REFRESH_SECONDS), verification evidence snippets, the final screenshot artifact path, and any known remaining gaps.

Versioned Publishing (Safe Edit → Promote)

Versioning actions apply only to genesis-versioned apps. Git-backed apps (managed remote / Git source) must use FORK_TO_STANDALONE first; otherwise ENABLE_VERSIONING, CREATE_VERSION, PROMOTE_VERSION, and related calls return an ARTIFACT_IS_GIT_BACKED error.
CREATE_VERSION and PROMOTE_VERSION are user-gated. Edit and preview the working draft, then stop and report the preview URL. Do not snapshot or promote on your own initiative after a successful preview. Phrases such as “looks good”, “thanks”, or “that worked” do not authorize publication — wait for explicit requests like “publish it”, “promote it”, “make it live”, “push to production”, or “save and publish”.
The agent owns edit and preview. Save and promote run only when the user explicitly asks (in chat or via the Apps UI Promote control).
1

Enable versioning (when the user wants safe iteration)

Creates Version 1 from the current files. When assign_production is true (default) on an already-published app, v1 is pinned as production so live users keep seeing the pre-change state. Do not enable versioning on your own initiative.
2

Edit the working draft

Changes go to the working draft — production is unaffected.
3

Preview the draft

The draft runs at /api/apps/<id>/working-copy/proxy/. Production stays on the promoted version until the user publishes.
4

Stop and report

Tell the user the working-draft preview URL and which production version is still live (for example, “Preview is at /api/apps/sales-dashboard/working-copy/proxy/; production is still on v3. Say if you want me to save and publish, or promote from App History.”). Also include the --working-copy chat embed from the tool’s reminders response (see Embedding Apps in Chat) so the user can review unpublished draft changes inline. Do not call CREATE_VERSION or PROMOTE_VERSION yet.
5

Save a version (only when the user asks)

6

Promote to production (only when the user asks)

7

Roll back (only when the user asks)

Genesis also records file-level checkpoints. In the dashboard UI these appear inside App History, and for versioned apps the checkpoints are grouped beneath their parent saved version as dot releases such as v2.1. LIST_CHANGE_HISTORY also returns a compact summary for each checkpoint so agents can scan rollback candidates quickly. For app-tool behavior after a Databricks restart, see Databricks working-copy recovery.

Building a Presentation

1

Create and scaffold

2

Edit presentation_deck.json

Author each new slide as kind: "canvas" with its own html, laid out on a fixed 1920x1080 stage that scales to the viewer. Use HTML and CSS for the slide’s composition instead of relying on the older fixed layouts. Put shared CSS in the deck-level styles string, and prefix your class names so they do not restyle the player. The player supplies the deck title, navigation controls and slide counter. Canvas slides can include staged reveals with data-stage and named charts in charts; see the presentation-deck schema for their full contract. Older standard, plotly and python slides still play, but REVIEW flags them as slide.legacy_kind; rewrite one as a canvas slide when you edit it.A canvas chart can read a linked dataset live by setting live_dataset on its chart spec. Name the dataset, table and default x/y columns; a trace can override those columns. For example:
Link the dataset to the app before starting it. A missing table column, empty result, or result with no plottable values appears as a chart render error in REVIEW.For older fixed-layout slides, t is the visible title, s the visible subtitle/body HTML, and n the narration. t accepts either a plain string, {"text":"Plain title"} for escaped text, or {"html":"<span>Styled</span>"} for explicit safe title markup. When you use the object form, include exactly one key: html or text. Keep title styling in s when the title does not need inline markup. Export/publish validation rejects slides that store visible text only in alias fields such as title, subtitle, body, body_text, bullets, left_content, right_content, or two_column, and it also rejects slides with no visible content. A canvas slide’s HTML is its visual content. Older non-text slides should provide visible img, plotly, py, or staged label/sub content. When you update presentation_deck.json through WRITE_FILE or WRITE_FILES, Genesis also returns warnings and hints when it detects long-form alias keys without the canonical short fields.To offer related decks or explainer videos after playback, add an optional up_next array to the deck JSON. It accepts up to three entries with another app’s canonical app_id (2–64 lowercase letters, digits, or hyphens, beginning and ending with a letter or digit), a required title (up to 120 characters), and optional subtitle (up to 200 characters); for example:
VALIDATE rejects malformed entries, duplicate IDs, and the current deck’s own ID. At the end screen, cards can show the other app’s thumbnail and length when available; selecting one opens it in the Genesis Apps viewer. Without up_next, the end screen offers Replay alone. Exports, print, and slide-only captures do not include the cards.
3

Validate the deck workspace

Run this before export or before a gated first START / RESTART to catch missing presentation_images/* paths, slide/stage URL targets, slide_range selection errors, stage-sweep gaps, visual-coverage gaps, and audio/captions issues early. validate_check_images and validate_check_audio both default to true. Use slide_range="1-6" to validate only part of a deck, and add stage_sweep=true when those targeted slides must already expose staged content. When narration intent is explicit via deck metadata or presentation_deck.json audio.format, missing fallback narration clips become blocking errors instead of warnings. For kind="python" slides or stages, py / python must point to a file under presentation_slides/*.py that defines callable render(ctx). Those renderer files are loaded as standalone workspace scripts, so prefer absolute imports such as from presentation_slides.utils import helper instead of relative imports.
4

First start: clear the deck gate and launch

The first START / RESTART is blocked until both flags succeed once. Genesis runs structured deck validation before launch, then auto-captures slide 1 (the first authored content slide) rather than the splash gate shell. The gate clears only when that capture shows real slide content instead of an empty, loading, error, or broken-asset state. Font-only subresource failures are tolerated; other broken deck assets block the gate. After the gate is cleared, later START / RESTART calls remain warning-only.
5

Generate narration (optional)

The app must already be running. If the selected slides do not contain narration in n, the tool returns success=false with hints telling you to move narration text into n. If the Genesis-configured TTS path returns invalid_api_key, retry with use_genesis=false and a valid direct api_key value or stored secret_* reference.
6

Import an existing deck (optional)

Native Google Slides import now reads the deck in place through the Slides API, so large decks no longer depend on a Drive .pptx export succeeding.
7

Publish a snapshot export (optional)

Export defaults to format="pptx". It freezes the rendered Genesis app state into a PowerPoint-ready artifact and can publish that .pptx back into Google Slides. Slides are images rather than editable slide objects, chart values are frozen at export time, narration can be included in PowerPoint or Google Slides speaker notes, and audio is not embedded. For PDF, use format="pdf"; the result has one page per slide or build step, does not include narration or notes, and returns pdf_path.

Remote Deployment

GenesisApps can also run outside the Genesis host on supported remote backends. Use LIST_DEPLOY_TARGETS first to discover saved target_env and security_profile names. Then call DEPLOY with dataset_definition={"target_env":"<name>","security_profile":"<name>"} to reuse stored backend defaults such as cluster, region, namespace, and runtime identity settings. If target_env already declares the backend, runtime_type is optional; otherwise set it explicitly to eks, railway, docker, or databricks_apps. For versioned apps, add version_id="<saved_version_id>" to deploy a specific saved version remotely; omit version_id to deploy Production.
For EKS, DEPLOY now defaults service_type to LoadBalancer so REMOTE_STATUS usually reports a browser-reachable URL. Set service_type="ClusterIP" only when you intentionally want a cluster-internal URL instead. User-facing app links such as apps_action(action="URL") prefer these explicit public-base overrides before falling back to inferred hostnames: GENESIS_MCP_PUBLIC_URL, GENESIS_PUBLIC_URL, GENESIS_PUBLIC_BASE_URL, GENESIS_EXTERNAL_URL, SERVICE_BASE_URL, NGROK_BASE_URL, and FRONTEND_BASE_URL. Set one of them in hosted deployments when Genesis cannot infer the browser-facing hostname cleanly.
Remote deployment requires confirm_identity_delegation="true" unless a delegation grant covers a Databricks Apps deployment or a verified consent statement covers this action. A migration Mission’s grant, offered in the Start Mission modal, covers deployment as the person until that Mission ends; if it waits for the person’s signature, finish other work and deploy after they sign. For container backends, the acknowledgment confirms the app uses a process credential rather than a person’s identity. See delegation grant deployment rules and GenesisApp server token controls. A Databricks App instead runs as its own service principal and receives no Genesis app token.
When the person the app runs as said yes elsewhere, you can pass their verified statement with consent_statement_id instead of relying on the person’s own turn. Genesis accepts only their own words, said within the last 24 hours and delivered to this conversation (for example, relayed in a room you read). Use the statement ID (si_... or st_...) only when their words plainly cover this deploy, start, or stop; deciding whether they do is your responsibility. A summary or claim that they agreed is not a statement. This parameter does not count on a direct tool call because no conversation received the statement; a qualifying delegation grant is required for that call.
For a remote Databricks App, apps_action(action="START" or "STOP", runtime_type="databricks_apps") requires the person’s own turn, a Mission they started, a delegation grant naming the agent and app and covering the Databricks connection recorded on that app, or a qualifying consent_statement_id as described above. A direct tool call requires the grant; neither confirm_identity_delegation nor a consent statement applies to start or stop from a direct tool call. Revoking a Mission’s grant also removes its authority to start or stop the app.

Databricks Apps

runtime_type="databricks_apps" runs the app as a Databricks App on the workspace of the Databricks connection named in dataset_definition.databricks_connection_id. Genesis uploads the app’s source files to /Workspace/Users/<you>/genesis_apps/<app_name>. It leaves out local runtime state such as the app’s virtual environment, its logs and genesis_datasets.json. It then creates or reuses the app, starts its compute, and deploys a snapshot. For an AppKit app whose binding protects data, DEPLOY grants its viewers per-object access rather than SELECT on a schema. It does not revoke grants it did not record making; a later deploy revokes link SELECT grants recorded as made by an earlier DEPLOY for that app, and only in the same target. For secured views and their count views, DEPLOY checks that the live definitions still match the landing made from the app’s files before granting, and checks again before each view’s grants. If a view or one it reads has been replaced, its viewer grants are withheld and DEPLOY reports that the app’s tables must be re-landed before deploying again. If replacement happens after a view’s last check, viewers can read the replacement until DEPLOY’s post-grant check. DEPLOY then revokes grants this run made only when it confirmed they were not held beforehand; older or uncertain grants are reported as leftover access and are not revoked. Viewers also need CAN_USE on the SQL warehouse. Until Genesis records link landings (GEN-5916), DEPLOY gives viewers no SELECT on link tables; other existing access is audited, not revoked. DEPLOY records the grants in ported_viewer_grants and records ported_enforcement: NOT_ENFORCED until the runtime enforces ported functions. If the workspace refuses user authorization, those functions run as the app’s service principal, so viewer grants do not limit their reads; the ported_enforcement record includes that reason. See the [Foundry migration guide] (/docs/Integrations/Palantir-Foundry/Palantir-Foundry#migrating-and-proving-a-workshop-app) for the related landing and row-filter requirements. For an AppKit app without ported logic or a shipped binding, DEPLOY can derive viewer grants from rule-based actions when those actions write data protected by a row policy or secured_reads. It grants only the protected type’s secured and count views and filtered edits table, and the edits table must be in the app’s own configured write schema. If the config and shipped binding disagree about ported logic, including when an empty binding is presented as ported logic, DEPLOY fails closed and grants viewers nothing. When a protected AppKit app without ported logic would save as the signed-in viewer, DEPLOY withholds every rule-based save because viewers do not have access to the shared action log, batch table, or outbox; the app refuses the save before reading its request. This hold does not apply to ported functions: viewer-run functions are read-only, and an edit action’s completed plan is saved by the host. See the [Foundry migration guide] (/docs/Integrations/Palantir-Foundry/Palantir-Foundry#migrating-and-proving-a-workshop-app) for link-read refusals and save behavior. Saves continue to run as the app principal when user authorization is unavailable. A proof instance whose writes all stay in its own scratch schema is not subject to the rule-based save hold. The app’s service principal is granted USE CATALOG, USE SCHEMA and SELECT on every schema the app reads: the default schema of each Databricks connection it queries, and the schema of every catalog.schema.table its SQL or its datasets name after FROM or JOIN. This happens whether or not the app has write-back actions. A read grant confirmed missing is still attempted and reported by the normal read-grant step. On a redeploy over an app with an active or pending deployment, Genesis also checks whether the service principal’s read grants can be confirmed. If a read grant’s status cannot be read and the deploying connection is not confirmed as able to grant it, the redeploy is refused before replacing the running app. Required grants are different: grant_schema and the app’s write schema must be readable by the service principal, and a write table also needs MODIFY when the app writes as itself. Before creating or changing the app, DEPLOY checks whether the principal already holds each required grant and whether the deploying connection can grant any that are missing. It skips grants already held (including through groups or inheritance). If a required grant is missing and the connection cannot be confirmed as allowed to grant it, DEPLOY stops before creating or changing the app and names the grants to run. A failed effective-permissions read is unknown, not proof that a grant is missing. For an unknown grant that the deploying connection is not confirmed to be able to issue, a first deploy may proceed without that grant and reports the uncertainty in its notes. A redeploy over an app with an active or pending deployment is refused before replacement when a required grant cannot be confirmed, or when a read grant’s status is unknown and the deployer is not confirmed able to issue it. This prevents replacing a working app with one that may lose data access. After asking the person, a redeploy may set accept_unconfirmed_grants: true in that call’s deploy options; this acknowledges the risk but does not grant the privilege. It counts only when the person typed the current turn in their own web or Slack chat, and is refused in Missions, goals, and other agent-started turns. Saved target-environment and security-profile options cannot carry this acknowledgement. A grant confirmed missing still refuses deployment when the deployer cannot grant it. On a first deploy the app principal does not exist yet, so the deploying connection needs MANAGE or ownership on the securable or a parent, or metastore admin (and USE CATALOG / USE SCHEMA where required). ALL PRIVILEGES does not include MANAGE. After an administrator pre-grants the new app principal, later deploys can run without catalog-wide MANAGE. The read_access result reports each schema as readable, missing, or unknown, with grants made, grants still needed, and (when readable) the source of access. An effective-permissions check includes privileges held directly, through groups, or inherited from a parent; use the result to decide whether a separate grant is needed. Optional settings are warehouse_id (the SQL warehouse the app queries; defaults to the connection’s), grant_schema (one more catalog.schema to grant the same read on), and app_name (at most 30 lowercase letters, digits and hyphens; defaults to genesis-<app_id>, cut to 30 characters). For a Workshop app using Mapbox tiles, set mapbox_token_secret in DEPLOY’s dataset_definition to the Databricks secret reference "<scope>/<key>"; Genesis binds that secret to the app rather than copying its value into the workspace. Without this option, a Workshop app configured for Mapbox falls back to OpenStreetMap tiles. To let people or another service principal open the app, pass share_with as a list of objects, each naming exactly one user_name, group_name, or service_principal_name. share_with_connection accepts a Databricks connection ID and shares with the connection’s service principal (client_id); the connection must use auth_type: service_principal, or DEPLOY rejects it before creating the app. The caller and agent must have access to the connection. Both options grant CAN_USE on the app, using the deploying connection to PATCH its permissions without replacing its existing ACL. The principal named by share_with_connection also receives read access to exactly the schemas the app reads: USE CATALOG on each catalog, and USE SCHEMA plus SELECT on each schema. It receives no MODIFY or access to other catalogs. config.shared_with records these as read_grants, each with granted or failed status and the workspace error when refused. A failed read grant does not fail the deployment, but the Prover cannot read that schema until someone allowed to grant it runs the statement; deploying again with share_with_connection retries it. If specified, permission_level in a share_with entry must be CAN_USE; any other value is rejected before the app is created. A workspace refusal for an individual app-access grant does not fail the deployment: config.shared_with records each principal’s status (granted or failed) and, for a failure, the workspace error; deployment notes also report refused grants. A subsequent DEPLOY grants the principals recorded by the prior databricks_apps deployment again. Under a delegation grant, a redeploy reuses only the Databricks App whose service-principal ID the app’s last deploy recorded; a first deploy creates a new app and does not reuse an existing one. The recorded app’s resources and user-authorization scopes are not changed by a granted redeploy. Sharing beyond the app’s recorded recipients follows the rules in the delegation_grant_tools reference. A share_with_connection not already recorded gets app-use access only and no schema read grants; a connection already recorded keeps its recorded data-access behavior.
For AppKit projects, START runs the Node.js preview inside Genesis; DEPLOY builds a separate Databricks App. In mirror mode, the deployment includes an .npmrc with the registry URL and strict-ssl setting, but does not configure registry credentials or a private CA. In wheelhouse or disabled mode, the Databricks build still installs from the public npm registry on Databricks’ network; use mirror with a registry that the workspace can reach when public npm access is unavailable. Each Genesis AppKit start records its typecheck, lint, and smoke-check results in the app log ([APPKIT_CHECK]). DEPLOY refuses a failed or timed-out typecheck or failed smoke check only when the report matches the files being deployed. Lint findings are reported but do not block deployment; a missing or stale report also does not block it. Fix failed checks and RESTART the app to check the current files before deploying. To operate the remote compute without changing the Genesis preview, specify the backend on START or STOP:
These calls report the state Databricks returns immediately (commonly STOPPING or STARTING) and keep the deployment. Use UNDEPLOY to delete it. A migrated Workshop app can show another GenesisApp in place (embedded_apps in its workshop_app_config.json), such as a pop-up or an embedded inbox. Inside Genesis it frames that app’s Genesis copy; as a Databricks App it frames the linked app’s own Databricks App. DEPLOY resolves each linked app’s URL from its databricks_apps deployment and stores it in the app’s settings, so no code change is needed. Deploy each linked app first, on the same connection: DEPLOY refuses, before creating anything, an app whose linked app has no Databricks App yet, and names it. By default, DEPLOY uses those deployment URLs; pass an optional linked_app_urls object in dataset_definition to supply or override a URL, for example {"<app id>": "https://..."} for an app deployed outside Genesis. URLs must use HTTPS. Viewers need CAN_USE on each linked Databricks App. The embedded frame also has an Open in a new tab button for cases where the linked Databricks App does not render inside the frame. For a migrated Workshop app with write-back actions, DEPLOY detects their target tables and schemas. It requests Databricks user authorization with user_api_scopes: ["sql"], so actions can write with the signed-in viewer’s Unity Catalog permissions. Viewers need USE CATALOG, USE SCHEMA, and SELECT on the write schemas and read tables, MODIFY on the action tables, and CAN_USE on the SQL warehouse; DEPLOY returns the exact grants in its notes. If Databricks refuses the user API scopes or authorization update, the app writes as its service principal instead, and Genesis grants that principal read access to the write schemas plus MODIFY on the edits and log tables. Other app-update failures stop DEPLOY rather than silently switching to service-principal mode. The deployment result reports which mode is active. For an existing foundry_workshop_app, DEPLOY also notes when recorded, unedited template files are older than the shipped template; follow the note’s SCAFFOLD and RESTART steps before deploying again. A separate note for an unrecorded app.py requires checking that the file is unchanged template code before explicitly overwriting it. For the template’s media preview mapping, prompt suggestion-card behavior, optional embedded AI/BI dashboards, and the workspace security prerequisite, see the Foundry Workshop app migration guide. For the foundry_workshop_appkit template’s action support and limitations, see the Foundry Workshop migration guide. Genesis ships a runner, genesis_databricks_main.py, beside the app and makes it the app’s command. The runner serves the app’s app.py: a Flask app, or a Dash app through its app.server, at the root path /. Most GenesisApps then run unchanged, because the runner answers the app’s Genesis data calls itself. It starts a local stand-in for the Genesis API, and points the app’s GENESIS_API_* settings and app token at it:
  • POST /api/query (the templates’ genesis_query_rows()) runs the statement on the SQL warehouse, in the catalog and schema of the Genesis connection the app names. Only one read statement runs: anything after a ; is refused, and so is a WITH that writes.
  • /api/datasets/<id>, .../tables and .../tables|views/<name>/rows (the dataset fast layer) are served from a local SQLite snapshot. The snapshot is rebuilt from the dataset’s own source queries on the warehouse when it is first read, and again after an hour, or after the dataset’s TTL if it has one. It is built with Genesis’s own dataset store and query code, so dataset views run as they do in Genesis.
  • GET /api/health and /api/healthcheck return a local health response, and POST /api/apps/<id>/app-token/rotate returns the stand-in’s current per-process token.
  • A module-level query_rows(sql, max_rows=...), such as the one in the foundry_workshop_app template, is replaced by a direct statement on the warehouse.
The runner is never placed in the GenesisApp workspace, because it reads Databricks credentials, which a GenesisApp may not. Before anything is created on Databricks, a preflight reads the app’s source and refuses the deploy, listing every reason, when the app:
  • calls the Genesis LLM (genesis_llm_call, genesis_llm_direct, /llm/call, /llm/direct). An LLM feature whose function first checks that the LLM URL is set, as the dashboard scaffold’s AI insight does, is not refused. It reports itself unavailable, and the deploy result says so in notes.
  • calls another Genesis endpoint beyond the query, dataset, health-check, and token rotation routes above, such as /api/tts/speech, /api/apps/<id>/files/... or the dataset SSRM endpoint /api/datasets/<id>/datasource.
  • names a connection that is not a Databricks connection on the deploy workspace, or that Genesis cannot find. An app whose app.py defines a module-level query_rows (the foundry_workshop_app contract) is not refused for this: the runner replaces that function with a direct statement on the warehouse, and the deploy result notes the connection instead.
  • is bound to a dataset with a source other than SQL or inline data, a source whose SQL lives in a repository file (sql_path), or a source on such a connection.
  • has no module-level app in app.py.
The scaffolds dash_dashboard, flask_basic, flask_enhancement_inbox and foundry_workshop_app pass as shipped. presentation_deck is refused. The deploy result lists the packaged connections and datasets in config.packaged_connections and config.packaged_datasets. Unlike the other backends, a Databricks App does not call back into Genesis. No Genesis app token is minted for it, and it queries Unity Catalog as its own service principal. The returned URL is the app’s own: it is opened with a Databricks login, which the Genesis remote proxy cannot pass. A first deployment takes several minutes, while the app’s compute starts and the deployment builds.

Local runtime isolation

On root-run Genesis servers, local GenesisApps started with START / RESTART are not run through kernel confinement, regardless of security.code_isolation. If an app has a configured Linux user and sudo is available, Genesis runs it as that user; otherwise, it runs with the server process identity. On non-root servers, security.code_isolation=confine requires kernel confinement and the start is refused if the host cannot enforce it. On the first confined start, existing app state moves into a writable app/ subdirectory; Genesis-managed state files remain in the parent directory. Genesis sets MICROAPP_STATE_DIR to the app folder, preserving the app’s existing state while separating it from server-managed files.

Environment Variables

These are injected automatically into each app process at START / RESTART:
Never hardcode ports. Always bind to MICROAPP_HOST / MICROAPP_PORT.Be proxy-prefix safe. Dash apps must set requests_pathname_prefix and routes_pathname_prefix to MICROAPP_BASE_PATH. Flask apps should mount routes under url_prefix=MICROAPP_BASE_PATH.

App-scoped LLM calls

When app code needs model output, call the app-scoped Genesis routes with the viewer’s X-Genesis-App-Token (the one the request being served carries) rather than embedding third-party LLM API keys in the workspace:
  • POST /api/apps/{app_id}/llm/call runs one chat turn through a Genesis agent. Body fields: bot_id, prompt, optional thread_id, model_tier, provider, execution_lane, and timeout_seconds. Omit thread_id to create a new thread; when model_tier and provider are also omitted, Genesis seeds that new thread from the app authoring thread when available. An app message does not answer a person’s open question. For an existing thread owned by the viewer, check confirm_in_genesis_chat in the response and direct them to answer in Genesis chat when it is set; see the API response fields.
  • POST /api/apps/{app_id}/llm/direct runs a direct base completion without agent orchestration. Body fields: prompt, optional model_tier, provider, timeout_seconds, system, and images. system supplies instructions before the prompt; images accepts up to four base64 PNG, JPEG, GIF, or WebP data URLs, each at most 3.6 MB decoded. Invalid image data or a selected model that does not accept images returns HTTP 400. Omit model_tier and provider to inherit the app authoring thread defaults when available; otherwise Genesis falls back to main tier plus the deployment’s configured main provider.
  • Dash and Flask Basic scaffolds expose genesis_llm_call(...) and genesis_llm_direct(...), and Genesis injects GENESIS_API_APP_LLM_URL, GENESIS_API_APP_LLM_DIRECT_URL, GENESIS_LLM_BOT_ID, GENESIS_LLM_MODEL_TIER, and optional GENESIS_LLM_PROVIDER for that contract.

Data Access Patterns

Dashboard Default Path

For dashboard-style GenesisApps, use datasets first:
  1. CREATE
  2. SCAFFOLD
  3. DATASETS_SETUP
  4. ATTEST_CHECKLIST
  5. REVIEW
  6. START
Use direct /api/query only as an explicit fallback for prototypes, tiny result sets, debugging, or true realtime needs, and run DEV_QUERY_PREFLIGHT before relying on it for an interactive dashboard. Preflight now inspects both scaffold helper calls (genesis_query_rows() / genesis_query_df()) and direct requests.post(..., json={...}) /api/query payloads. If the workspace defines DEFAULT_CONNECTION_ID, preflight reuses that value for inferred query paths that do not set connection_id inline. If preflight reports query_health: "unknown", it means the tool still could not infer a concrete connection_id from the current app code, not that the query itself failed. This still commonly happens when the app reads the connection from GENESIS_CONNECTION_ID or another runtime-only source. Provide preflight_connection_id (or make the connection literal in code) before treating it as a live-query error. Prefer profile_mode="both" on DEV_QUERY_PREFLIGHT for dashboards so the same call returns latency plus structural findings such as grain mismatches, missing latest periods, and raw-vs-dedup deltas. When structural profiling runs, responses can also include structural_profiles, structural_findings, structural_query_profiles, and structural_summary. When a workspace has saved preflight state, apps_action(action="STATUS") also returns a compact preflight block. Genesis reuses cached health inside APPS_STATUS_PREFLIGHT_MAX_AGE_SECONDS (default 60) and otherwise runs a lightweight SELECT 1 smoke check against the saved connection before returning status. WRITE_FILES validates every requested file before writing any of them. If one entry is refused, the response lists the refused paths and the batch writes nothing; correct or remove those entries and retry the batch.

Template-backed writes

Use COPY_FILE or source-backed WRITE_FILE / WRITE_FILES with substitutions when you want large templates to stay in a repo instead of expanding them in chat context.
When apps_action is invoked through hosted MCP or POST /api/tool_call, Genesis allows raw HTML/CSS/JS/SVG content only for workspace-relative destinations under templates/, static/, or assets/ ending in .html, .htm, .css, .js, .mjs, or .svg. Other destinations keep normal string sanitization.

Dashboard readiness v2

New dashboard scaffolds can require the dashboard_readiness_v2 contract before the first meaningful start:
  • Call ATTEST_CHECKLIST with checklist_attestation, not checklist_answers, on v2 workspaces.
  • Each item in checklist_attestation.items must include id, answer, decision, and evidence.
  • data_plausibility_checklist.questions[*].override_supported marks checklist items that accept checklist_attestation.structural_overrides.
  • checklist_attestation.structural_overrides is optional and uses {item_id, justification, verified_by} entries for eligible items grain, time_range, magnitude, and consistency. justification must be at least 20 characters, and verified_by must be one of DEV_QUERY_PREFLIGHT, dataset_query_tool, or external_check.
  • query_result evidence must include inline result rows or data, and time_range evidence accepts ISO dates plus year (2015), year-month (2015-04), and year-quarter (2015-Q2) last_period_end values.
  • tool_result_ref resolves the current workspace state by label, or by structural identifiers such as finding_type, finding_id, or check_id.
  • data_plausibility_checklist also exposes structural_overrides_help and dry_run_supported=true; pass top-level dry_run=true to ATTEST_CHECKLIST to validate evidence shape without persisting the attestation.
  • For demos and prototypes, pass attestation_mode="sample" or sample_dashboard=true to use the explicit sample contract. Sample mode still requires source_choice, grain, and dataset_strategy, while magnitude, consistency, and time_range are reported as non-blocking validation details.
  • Sample-mode failures can return attempted_attestation_context with the attempted attestation_mode, whether sample_dashboard was requested, and the required question ids checked for that attempt. attestation_status continues to describe the last persisted workspace attestation until a non-dry_run submission succeeds.
  • In sample mode, grain can also be satisfied by a current auto_profile_ref structural profile, including heuristic sample-dashboard profiles, when that saved profile still matches the current workspace fingerprints.
  • For additive KPI dashboards, exact grain proof can come from a fresh structural grain_check / raw_vs_dedup result with exact confidence, or from inline query_result evidence whose summary rows include total_rows and distinct_entities aligned with the grain decision.
  • Known bundled demo connections such as formula_1_sqlite, baseball_sqlite, credit_card_sqlite, asset_mgmt_sqlite, or workspace_sqlite may trigger an advisory suggesting sample mode; Genesis never switches modes automatically.
  • Invalid v2 submissions default to compact responses. Genesis may still repeat the checklist schema when the thread has not seen it yet unless you explicitly force compact=true. In compact failures, inspect failing_item_ids, compact_item_errors, corrected_minimal_examples / corrected_example_items, attempted_attestation_context, and schema_followup. Use compact=false when you need the full checklist schema again, including item_validation_details, submission_rules, structural_overrides_help, and the example command. After the checklist schema has already been emitted in a thread, repeated compact failures can suppress data_plausibility_checklist.questions[*] and keep only the machine-correctable fields.
  • When time_range.decision.covers_expected_period contradicts evidence, item_validation_details.time_range.resolution_hints[] explains whether to refresh the dataset/source or record the observed stale last_period_end.
  • attestation_status.time_range_summary surfaces last_period_end, expected_end, covers_expected_period, and days_behind when available so app chrome can display freshness state without parsing raw evidence. When the latest period still lags the expected period, app advisories can also include freshness_banner with a ready-to-display warning message.
  • If genesis_datasets.json is already bound, dataset_strategy can auto-satisfy.
  • For dashboard_readiness_v2, freshness is scoped to the data proof fingerprint rather than ordinary app.py edits. attestation_status.code_changed_since_attestation still flags code drift for visibility.
  • Genesis computes a workspace source fingerprint from primary config files (app.py, requirements.txt, genesis_datasets.json, genesis-microapp.json, genesis_branding.json, presentation_deck.json, and for presentation decks presentation.js and presentation_styles.css when present), asset directories (templates, static, assets), and every authored .py module in the workspace (excluding build/cache directories such as .venv, node_modules, and __pycache__). Edits to helper modules or deck runtime assets therefore invalidate cached first-start REVIEW results tied to an older fingerprint. START / RESTART also treat changes to presentation.js or presentation_styles.css as restart-relevant, just like app.py and requirements.txt.
  • The first START or RESTART is blocked until attestation is fresh and REVIEW passes once. START and RESTART normally attempt that REVIEW automatically and surface any blocking findings so you can fix them and retry. A standalone passing REVIEW may start and stop a temporary preview runtime; call START next to launch the persistent runtime.
The Datasets fast layer pre-materializes query results into SQLite snapshots. This avoids hitting your data warehouse on every dashboard page load.
  1. Define a dataset with DATASETS_SETUP or the dataset_create_tool.
  2. Bind it to the app via genesis_datasets.json:
  3. Restart the app so dataset bindings and dataset env vars are refreshed.
  4. GET /api/datasets/<id> also returns top-level freshness helpers for app code: active_snapshot_id, last_refresh_at, snapshot_built_at, row_counts, and table_name_mapping.
  5. In your app code, fetch data from /api/datasets/<id>/tables/<table>/rows with the viewer’s token. Every request the Genesis proxy forwards to the app carries a short-lived token naming the person viewing it, in the X-Genesis-App-Token header; send that one:
    POST /api/datasets/<id>/datasource also accepts table or view in the SSRM request body (or query string) when the dashboard should target a specific dataset table or view instead of the dataset default target.
Reads run only as the person viewing the app. Genesis refuses a data, query, action or LLM call made with the app’s own GENESIS_APP_TOKEN with 403. For a read during a viewer’s request, STATUS reports health: "degraded" and last_api_error.reason: "viewer_required": the read named no viewer. A restart does not change that. Use the request’s X-Genesis-App-Token header instead; the viewer’s token is scoped to what that person may read, so a viewer who lacks access to a bound dataset is refused on it even though they may open the app. A startup or pre-warm read with nobody viewing is expected and does not degrade the app.
  • Startup code, background threads and scheduled refreshes inside the app have no viewer, so they cannot read. Read in the request handler (or Dash callback) instead.
  • Genesis’s own page loads with no person behind them (a pre-warm after START or RESTART, a thumbnail) read nothing. A viewer_required refusal when no viewer request is open is recorded separately as no_viewer_reads and does not degrade the app.
  • If STATUS reports runtime_health.problem, the app process could not load Genesis’s runtime support and its viewer-token forwarder. The process’s reads while serving a viewer then use its own token; health is degraded even before a refusal is recorded. Restarting the app does not fix an unreadable runtime-support directory; ask the Genesis administrator to correct the deployment.
  • apps_action INSPECT_RUNTIME_STATE and CAPTURE open the app as the person the agent acts for; on a person’s own scheduled job, that is the job’s owner. A job scheduled by an agent or machine acting through a borrowed turn (such as mail or another agent) runs without inheriting the conversation owner’s identity. The viewer needs access to the app and each dataset it reads.
  • The Genesis runtime also swaps the viewer’s token onto outbound requests and urllib calls made while a Flask or standard-library server request is served, but code that reads the inbound header itself, as above, does not depend on that.

Direct Query (Fallback)

For small, ad-hoc queries you can call /api/query directly:
The Dash scaffold already includes genesis_query_rows() / genesis_query_df() helpers around this pattern. Reuse those helpers when possible instead of hand-parsing the response. Read the response as body["data"]["rows"], not body["data"] as a list. DEV_QUERY_PREFLIGHT can inspect both the scaffold helpers and direct json={...} payloads for /api/query. Keep query and connection_id literal when possible so preflight can auto-profile the live-query path. If multiple inferred queries share one connection, set DEFAULT_CONNECTION_ID in the workspace so preflight can reuse it automatically. DEV_QUERY_PREFLIGHT does not execute PRAGMA ... statements. For schema discovery, use SELECT * FROM <table> LIMIT 1 and inspect the returned columns. If Genesis detects more live-query call sites than the latest preflight covered, the response can include coverage_gap and may add a blocking finding for dashboard apps with a large gap. Re-run preflight with preflight_queries covering the actual query paths before relying on the result.
Do not pass a dataset-prefixed connection_id such as dataset.my_dataset to /api/query. That route expects a real database connection. For dataset-backed reads, use the scaffold helpers genesis_dataset_df(), genesis_dataset_frame_with_meta(), or dataset_read_or_query_fallback(), which call /api/datasets/{id}/{tables|views}/{name}/rows.
There is no SQL-style POST /api/datasets/{id}/query endpoint. If an app calls it, Genesis returns a structured 400 with suggested dataset rows and datasource endpoints. Use /api/datasets/{id}/tables/{table}/rows, /api/datasets/{id}/views/{view}/rows, or /api/datasets/{id}/datasource instead.
Use Datasets for production dashboards (performance + caching). Use /api/query only for preflight-approved prototypes or truly real-time needs.

Access Control

GenesisApps support four privilege levels: When platform auth is enabled, agent tool operations check the requesting user’s app privileges, just like the corresponding UI operation. For apps_action, the required privilege depends on the operation and runtime source: Calls without a user identity are rejected for operations other than READ_FILE. With authentication enabled, a newly created app is private to its creator until it is shared. Access to the agent that built the app does not automatically grant access to the app; grant app privileges separately below. LIST follows the Apps Library visibility rules: a person must have view access, an unpublished app is listed only to its owner or a manager, and a versioned app without a Production version is listed only to managers. With platform auth disabled, LIST does not filter apps by user visibility. For versioned apps, REVIEW without run_source evaluates the working copy and therefore requires edit. READ_FILE uses the same per-app read rule as files in the shared GenesisApps repository. An agent-only read with no grant is logged but not blocked in this release; when no reader is bound, no person’s per-app rule applies. Other GenesisApps operations keep the privilege shown above. Common patterns:

Published vs. Draft

  • Draft (default): Only the owner can see the app in the Apps panel.
  • Published: The app appears in the Apps panel for anyone with view access.

Embedding Apps in Chat

Embed a running GenesisApp directly in a chat message using a fenced code block:
For genesis-versioned apps, use the --working-copy flag when you want the user to preview unpublished draft changes instead of production:
After WRITE_FILE or WRITE_FILES on a versioned app, apps_action returns this embed block in the reminders array — include it verbatim in your next reply so the user can review the draft inline. This renders the app inline in the conversation — great for presenting results to stakeholders without them needing to navigate to the Apps panel.

Diagnostics and Troubleshooting

REVIEW (One-Stop Diagnostics)

The REVIEW action combines verification, screenshot, and log analysis:
For new dashboard workspaces, REVIEW also clears the one-time first-start gate and can block when ATTEST_CHECKLIST proof is missing, contradictions remain between decision and evidence, or structural findings are still unresolved. When a review runtime is already running but its last_started_fingerprint no longer matches current_source_fingerprint, Genesis stops the stale runtime and provisions a fresh one so REVIEW evaluates the current working copy. If the app was already serving that runtime, the replacement runtime is kept running after REVIEW completes instead of being torn down like a throwaway preview. For truly static/no-data Dash apps, pass no_data_declared=true on REVIEW only when the workspace has no Genesis dataset binding, live-query path, or /api/datasets call. If the source scan agrees, the response sets no_data_attestation_bypass=true and clears the attestation gate from health plus rendered-content evidence instead of checklist proof. When START or RESTART reports a blocking gate and you want the safest next move, call apps_action(action="EXPLAIN_BLOCKING", app_id="my-app"). It summarizes the active blocker and recommends the next apps_action call instead of making you infer it from raw state. For apps that render charts or other content asynchronously, pass wait_for_render_signals such as {"chart_data_detected": true} or {"plotly_chart_count": {"gte": 2}} so capture waits for semantic readiness instead of a fixed delay. Prefer semantic signals over exact counts when you can. Capture-style responses echo both render_signals and wait_signals so you can see which semantic wait condition completed. Setting include_visual_description=true adds extra latency because Genesis runs a follow-up vision pass after the screenshot is taken. For Workshop app states, prefer addressable states in url_suffix such as ?__tab=<tab id>, ?__overlay=<overlay id>, or ?<input>=<key>. If the state has no address, click_selector can use a Playwright role selector such as role=tab[name="Orders" s]. A text-only button selector targets the tab with that name first, then a button with that name; it does not click an arbitrary first element containing the text. Genesis Desktop’s first-use browser-tools download during app capture or runtime inspection is described under Browser Tools. The durable chat uploads guide also covers screenshot persistence for CAPTURE and automatic capture after START or RESTART. For Dash dashboards, Genesis does not switch into presentation-deck review logic just because capture payloads include empty genesis_export_* fields. Presentation handling applies only when the app runtime is actually presentation_deck or capture data contains a real presentation value such as genesis_export_slide_kind or genesis_export_blockers, so dashboard-first review can still clear from positive render signals like chart_data_detected, ag_grid_row_count, and non-zero KPI values. [GENESIS_QUERY_OK] and [GENESIS_DATASET_OK] app log markers are useful diagnostics, but REVIEW does not require them as the only proof. For dataset-backed dashboards, Genesis also inspects bound dataset metadata and readable snapshot rows. If neither markers, dataset readiness, nor populated capture evidence are available, REVIEW returns hints for the agent: bind or refresh a materialized dataset, keep/add a live-query marker, make populated runtime data visible to capture, rerun after async callbacks finish, and inspect dataset/query/callback errors. For narrated decks, use SWEEP_CAPTURE when you want a whole-deck audit instead of a single screenshot. If both slide and slide_range are omitted, Genesis captures the full presentation_deck.json range automatically, stage_sweep defaults to true, and the response returns summary, per-slide slides[], failed_slides, slides_with_error_banners, and recommended_next_steps.

Interactive browser flows

For multi-step validation on a running GenesisApp, use Browser Tools alongside apps_action instead of relying only on CAPTURE or REVIEW. This is the preferred path when you need to click buttons, fill forms, move between pages, or confirm post-click UI state. Open the app proxy URL with browser_open, for example browser_open(url="/api/apps/<app_id>/proxy/"), then use browser_snapshot, browser_click, and browser_type within the same session. For the app-scoped, person-authorized ticket used by the browser, see Browser Tools. Finish with browser_close when you are done. It returns:
  • verify: Health check results (proxy reachability, healthz status, Dash layout validation)
  • capture: Screenshot of the app
  • logs: Recent log output
  • findings: Auto-detected issues (callback 500s, query errors, shape mismatches)
  • hints: Actionable fix suggestions

Common Issues

For WRITE_FILE and WRITE_FILES, history placeholders are refused rather than written as file content. See the file-write placeholder guidance.

Best Practices

Use Datasets for Dashboards

Avoid hammering your warehouse. The Datasets fast layer caches data in SQLite snapshots — dashboards load in milliseconds.

Restart After Code Changes

Code and dependency changes only take effect after RESTART. Use restart_after_write=true to combine write + restart.

Read the Skill First

The apps-build-basics skill contains the canonical GenesisApps workflow. Build and runtime actions require an active app skill in thread context; CREATE may register the app first, then CHECK_PREREQUISITES shows the activation step before scaffold/write/start work. For hosted MCP or other stateless callers, use the gateway read_skill or list_skill_files actions instead of relying on manage_context(action="ADD_CONTEXT", ...), then retry apps_action.

Verify Before Sharing

Always run REVIEW before publishing. It catches proxy issues, callback errors, and data-loading failures automatically.

Parameters Reference

apps_action Parameters

presentation_deck_generate_tts Parameters

When authentication is enabled, narration runs as and is charged to the person who requested it. That person must be allowed to view the app; if not, narration is refused before it starts. With authentication disabled, the app’s existing system identity is used.