Skip to content

fix: review agent app requests before first use - #510

Closed
ahmad-ajmal wants to merge 1 commit into
devfrom
codex/remove-agent-app-trigger-approval
Closed

ahmad-ajmal wants to merge 1 commit into
devfrom
codex/remove-agent-app-trigger-approval

Conversation

@ahmad-ajmal

@ahmad-ajmal ahmad-ajmal commented Oct 28, 2026 •

Copy link
Copy Markdown
Collaborator

What

Move Agent App request approval to a visible review modal on first launch and when delivered request definitions change. The app starts in the background while the user reviews the requests; triggering an agent run never starts a separate consent-question run.

  • Apply the same review flow to marketplace/imported apps and apps created or evolved in CraftBot. Show descriptions, expandable instructions, and labels for new, changed, and already allowed requests.
  • Let the user allow requests or keep them off while continuing to use the app. The app page shows the current permission state and a Review requests button to allow or revoke them later. Saved decisions survive reloads and restarts; unchanged allowed requests do not prompt again.
  • Bind approvals to the app identity and the exact reviewed definitions. Reject stale dialogs and changed instructions, discard shipped approval records on acquisition, and preserve bridge authentication, capability checks, cooldowns, and development-environment deferral.

Why

An app could appear broken because its first request was refused pending an approval the user did not know was required. Users need to see and approve what the app may ask CraftBot to do before those requests run, especially for third-party apps.

Legacy per-app approval booleans do not identify the reviewed definitions, so existing apps receive one UI review. The agent-facing approval action, chat consent prompts, and automatic pre-approval during creation/promotion are removed. Declining does not uninstall or stop the app, and previously blocked requests are not automatically replayed after approval.

How to test

  1. Import/install or create an app with declared agent requests and launch it. Confirm the review modal appears before any request is allowed, with the app running in the background.
  2. Choose Keep requests off. Confirm normal app use is available, requests remain blocked, the app page offers Review requests, and reloading does not repeat the same declined prompt.
  3. Open Review requests, choose Allow requests, and fire a declared request. Confirm the agent completes it without asking for consent in chat. Reopen review to revoke access if desired.
  4. Deliver a new or changed request definition. Confirm it requires a fresh review; an unchanged allowed definition retains its approval. A stale dialog must not approve the changed definition.
  5. Restart/reconnect with unchanged definitions. Confirm the saved decision is retained. Apps without requests must not show an approval modal.

Validation:

  • 65 targeted Python tests passed, including bridge gates, saved decisions, legacy flags, copied publisher approvals, acquisition reset, changed definitions, stale reviews, and UI decision handling.
  • 5 Playwright browser tests passed for initial review, allow/decline/reopen, changed definitions, stale-dialog retries, and disconnect/reconnect behavior.
  • Trigger-plane and data-safety acceptance suites: both passed in disposable profiles.
  • Changed Python files pass Ruff lint/format; TypeScript tsc --noEmit, Vite production build, source byte-compilation, and git diff --check pass.
  • Full-repository Ruff has the same two existing F402 errors in app/credentials/vault.py (1087 and 1145) as the base branch.

Screenshots / Logs

Live verification used the real CraftBot backend, PocketBase app, and configured model in an isolated profile:

Case Observed result
Before UI approval Bridge returns 403 without starting a consent-question run
Keep requests off App remains usable; review banner remains; decision survives reload
Allow through the modal A declared request is claimed and completed by the agent
Change the allowed definition Bridge returns 403; modal identifies Changed request and Already allowed entries

The review modal also explains that app requests can start agent work and use connected services, including while the app is not being viewed.

@ahmad-ajmal ahmad-ajmal self-assigned this Oct 28, 2026
@ahmad-ajmal
ahmad-ajmal requested a review from zfoong October 28, 2026 12:09
Signed-off-by: ahmad-ajmal <ahmadajmal1514@gmail.com>
@ahmad-ajmal
ahmad-ajmal force-pushed the codex/remove-agent-app-trigger-approval branch from e71f9a9 to 013a692 Compare October 29, 2026 09:34
@ahmad-ajmal ahmad-ajmal changed the title fix: remove agent app trigger approval requirement fix: review agent app requests before first use Oct 29, 2026
@ahmad-ajmal
ahmad-ajmal deleted the codex/remove-agent-app-trigger-approval branch October 29, 2026 09:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant