Download the PHP package promptphp/intercept-tool-approval-guard without Composer

On this page you can find all versions of the php package promptphp/intercept-tool-approval-guard. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package intercept-tool-approval-guard

Introduction

ToolApprovalGuard is a Laravel AI SDK agent middleware that inspects the tool calls an agent proposes while pausing for human approval, before those calls are ever surfaced for review.

It can block, log, or fully delegate handling to a custom callback.

[!Important] This middleware is part of the Intercept middleware collection. It inspects the tool calls the model proposed. It cannot inspect the tool results, retrieved documents, or conversation history that may have influenced them.

Why this matters

Intercept sees the prompt on its way to the provider. It does not see what a tool returns, what a retrieval step pulled in, or what the model then decided to do with it.

When an agent is manipulated by content Intercept never saw, the damage shows up as a tool call:

ToolApprovalGuard inspects those proposed calls. It is the first point downstream of that blind spot where the middleware pipeline can act.

By default it is the card number that flags this call, not the address. A mail tool is expected to carry an email address, so the defaults cover only values that are essentially never a legitimate argument: card numbers, API keys and bearer tokens. Contact data and locators can be added, but the destination itself is better controlled with allowed_tools / denied_tools and domain allowlisting inside the tool.

Quick start

Installation

You may publish the config or not, the middleware works out of the box.

Usage

Return the ToolApprovalGuard middleware on an agent's middleware method.

[!Important] To add middleware to an agent, implement the HasMiddleware interface and define a middleware method that returns an array of middleware classes.

The middleware only acts when a run pauses for approval. Agents without approval-gated tools are unaffected.

Restricting which tools may be proposed

An empty allowedTools permits every tool. A non-empty list permits only those named.

Observing before enforcing

For the complete guide, see the full documentation below.

Documentation

Full documentation can be found at https://intercept.promptphp.com/ or the docs directory on GitHub.

Contributing

Thank you for considering contributing to Intercept by PromptPHP. The contribution guide can be found in CONTRIBUTING.md.

Code of Conduct

We follow the Laravel Code of Conduct. We expect you to abide by these guidelines as well.

Security Vulnerabilities

If you discover a security vulnerability within Intercept by PromptPHP, please email Victor Ukam at [email protected]. All security vulnerabilities will be addressed promptly.

License

Intercept by PromptPHP is open-sourced software licensed under the MIT license.

Support

This library is created by Victor Ukam with contributions from the Open Source Community. If you've found this package useful, please consider sponsoring this project. It will go a long way to help with maintenance.


All versions of intercept-tool-approval-guard with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
laravel/ai Version ^1.0
promptphp/intercept-injection-guard Version *
promptphp/intercept-pii-redactor Version *
promptphp/intercept-support Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package promptphp/intercept-tool-approval-guard contains the following files

Loading the files please wait ...