Skip to content

Conversation

@iscekic
Copy link
Contributor

@iscekic iscekic commented Nov 10, 2025

Context

We want to make yolo mode a bit safer by introducing a gatekeeper AI, which will approve or deny each action taken by the yolo mode agent.

Implementation

The main file where everything happens is gatekeeper.ts. The other changes are all due to singleCompletionHandler (and in turn, completePrompt) changing the return type due to us needing to show costs for a gatekeeper request.

For each action the coding agent wants to take, the gatekeeper agent is asked "do you approve?". Some non-destructive tools are pre-approved.

Screenshots

image image image image image

How to Test

  1. Open settings, add a new configuration (see screenshot)
  2. Go to Auto-Approve -> enable yolo mode and set the new configuration as the gatekeeper
  3. Start any task - you should have benefits of auto mode with some safety

Get in Touch

N/A

@iscekic iscekic self-assigned this Nov 10, 2025
@changeset-bot
Copy link

changeset-bot bot commented Nov 10, 2025

🦋 Changeset detected

Latest commit: 6eb561c

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
kilo-code Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@iscekic iscekic requested a review from Copilot November 11, 2025 19:00
Copilot finished reviewing on behalf of iscekic November 11, 2025 19:04
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds a "smart YOLO mode" feature that allows users to configure an AI gatekeeper model to evaluate actions before auto-approving them in YOLO mode, providing a safety layer. The implementation includes:

  • A new yoloGatekeeperApiConfigId setting to select which model acts as the gatekeeper
  • Comprehensive gatekeeper evaluation logic that assesses tool operations based on risk
  • Modified completePrompt API signature across all providers to return structured results with usage information and support system prompts
  • UI integration in the auto-approve settings panel

Reviewed Changes

Copilot reviewed 79 out of 79 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
webview-ui/src/context/ExtensionStateContext.tsx Adds state management for gatekeeper API config ID
webview-ui/src/components/settings/SettingsView.tsx Integrates gatekeeper config into settings
webview-ui/src/components/settings/AutoApproveSettings.tsx Adds UI dropdown for selecting gatekeeper model
src/core/assistant-message/kilocode/gatekeeper.ts Core gatekeeper evaluation logic with git awareness
src/core/assistant-message/presentAssistantMessage.ts Integrates gatekeeper into tool approval flow
src/api/index.ts Defines new SingleCompletionResult interface
src/api/providers/*.ts Updates all providers to support system prompts and return usage info
src/utils/single-completion-handler.ts Updates to accept system prompt parameter
packages/types/src/global-settings.ts Adds gatekeeper config to global settings schema

@iscekic iscekic marked this pull request as ready for review November 11, 2025 19:22
@chrarnoldus
Copy link
Collaborator

The other changes are all due to singleCompletionHandler (and in turn, completePrompt) changing the return type due to us needing to show costs for a gatekeeper request.

Wouldn't you avoid most of these changes by using the streaming function? (createMessage)

@iscekic
Copy link
Contributor Author

iscekic commented Nov 11, 2025

The other changes are all due to singleCompletionHandler (and in turn, completePrompt) changing the return type due to us needing to show costs for a gatekeeper request.

Wouldn't you avoid most of these changes by using the streaming function? (createMessage)

I think you're right, I didn't realize it also returned usage along with the message. 🤦🏻‍♂️

I'll push an update tomorrow.

@iscekic iscekic marked this pull request as draft November 11, 2025 20:54
@iscekic iscekic marked this pull request as ready for review November 12, 2025 11:44
@iscekic
Copy link
Contributor Author

iscekic commented Nov 12, 2025

Ready for another look.

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.

3 participants