Skip to content
KitploitKITPLOIT
ToolsBlog
Log in
Submit
ToolsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

FeedsContactPrivacy© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
ToolFence_v2 — Capability-authorisation and transaction-ledger defence layer for tool-using LLM agents, with policy compilation, parameter provenance checks, and auditable tool execution. | Kitploit
Tools/GitHubGitHub/polyliyj/toolfence_v2
Authentication & AuthorizationDefensive ToolsIdentity & Access Management (IAM)Papers & ResearchAI Security
GitHubpolyliyj/toolfence_v2

ToolFence_v2

Capability-authorisation and transaction-ledger defence layer for tool-using LLM agents, with policy compilation, parameter provenance checks, and auditable tool execution.

View Repository
12h 21m agoNot yet reviewed
Share

ToolFence

Anonymous source repository for paper: ''ToolFence: Fine-Grained Authorization for Secure Tool-Using LLM Agents`` reorganised and modified from the original implementation. This project implements a capability-authorisation and transaction-ledger defence layer for tool-using agents, including a policy compiler, parameter provenance checking, dynamic capability granting, persistent transaction accounting, and targeted test suites.

This repository contains no non-public data, credentials, or model weights.


Figure: ToolFence runtime and authorisation boundary overview

Overview

ToolFence enforces bounded, auditable tool execution for LLM agents. It separates policy compilation, runtime monitoring, and capability approval from the agent itself, using:

  • typed tool manifests and fixed trusted catalogues
  • isolated semantic policy compilation
  • atomic transaction reservations, receipts, and reconciliation
  • deterministic fast-path checks + guarded dynamic capability authorisation
  • strict provenance rules for derived parameter bindings
  • a ledger-backed execution boundary independent of online model services

AgentDojo is only used as an external benchmark framework; the core ledger and authorisation logic do not depend on it.

Repository Structure

The source tree is under ToolFence_anonymous 3/; paths in the table below are relative to that directory.

LocationCorresponding Mechanism
src/toolfence/guarded_net.py, transaction_net.pyWorkflow stages, capability & evidence transaction ledger; atomic reservation, trusted receipts, dynamic authorisation proposals, intra-task authorisation
src/toolfence/semantic/Isolated policy compiler, typed tool catalogues & capabilities, concrete parameter and provenance validation
src/toolfence/hybrid/Deterministic fast path, dynamic capability authorisation, cross-session capability shape cache
src/toolfence/runtime.py, colored_runtime.py, agentdojo_defense.pyAgent runtime and final guarded ledger execution boundary
src/toolfence/judge/, core/, foundation/Isolated reviewer, shared monitoring logic and foundational authorisation structures
experiments/Host sandbox examples that do not depend on models
tests/unit/Regression tests for transactions, parameter provenance, dynamic authorisation and paper-mode behaviour

Installation

Requires Python 3.10 or newer.

cd "ToolFence_anonymous 3"

# editable install with test dependencies
python -m pip install -e '.[test]'

# run unit test suite
python -m pytest -q tests/unit

Import:

import toolfence

Full tests require AgentDojo for benchmark boundary integration. Either install AgentDojo into your environment or provide it via PYTHONPATH. Core functionality works without AgentDojo.

Sandbox Examples

These examples do not invoke LLMs or real external tools. They validate mechanism behaviour only and do not measure prompt injection success rates.

cd "ToolFence_anonymous 3"
python experiments/run_guarded_net_cases.py --output output/guarded-example
python experiments/run_refinement_cases.py --output output/refinement-example

Benchmark Evaluation

The three real benchmarks are AgentDojo, ASB (memory poisoning), and MCPTox. The runners and reviewed JSON manifests are under ToolFence_anonymous 3/experiments/real_benchmarks/.

Full prerequisites, model-server commands, external data paths, smoke tests, and per-benchmark options are documented in the benchmark README.

Quick start:

cd "ToolFence_anonymous 3"
python -m pip install -e '.[test,llm]'
python -m pip install agentdojo
export PYTHONPATH=src:.
export OUT=results_real/benchmarks_100

python -m experiments.real_benchmarks.run_agentdojo_100 \
  --subset-size 100 --model-profile qwen --judges qwen --output-dir "$OUT"
python -m experiments.real_benchmarks.run_asb_100 \
  --subset-size 100 --model-profile qwen --judges qwen --output-dir "$OUT"
python -m experiments.real_benchmarks.run_mcptox_100 \
  --subset-size 100 --model-profile qwen --judges qwen --output-dir "$OUT"

Before running the full suite:

  • AgentDojo: install the external framework and set TOOLFENCE_AGENTDOJO_SPLIT and TOOLFENCE_AGENTDOJO_SRC.
  • ASB: set TOOLFENCE_BLUEPRINTING to the Blueprinting source root and place the original ASB data under data/asb_orig/.
  • MCPTox: download the pinned response_all.json to data/mcptox/response_all.json (command in the benchmark README).
  • Models: the qwen profile expects an OpenAI-compatible endpoint on port 8000; llama70b expects port 8002. Select with --model-profile qwen|llama70b|both.

For a quick smoke test, replace --subset-size 100 with --smoke and use a separate output directory, e.g. OUT=results_real/benchmarks_smoke. To aggregate results:

python -m experiments.real_benchmarks.summarize_results \
  results_real/benchmarks_100 \
  --old-dir results_real/final_100_qwen

This writes summary.csv and REPORT.md under the result directory.

Core Concepts

The strict_capabilities=True mode changes behaviour for high-assurance defence:

  1. Capability authorisation failures reject the call; no fallback to ad-hoc LLM approval.
  2. SemanticPolicyCompiler uses a pinned ToolManifest and validates exact name/parameter matches against the trusted catalogue. Model-generated effect labels are overridden by the controller manifest.
  3. DERIVED bindings must point to a single named output field from a single upstream tool. Ambiguous or unstructured provenance cannot authorise sensitive parameters.
  4. Automatic local read exemptions are narrow: only host-reviewed local reads with external_disclosure=False and mutates_state=False. All parameters must be justified by the original user request.
  5. Cross-session caches store only capability approval signatures (no concrete values), keyed by policy revision. New task parameter bindings are always revalidated.

Trusted Host Integration

To attach ToolFence to your agent host:

  1. Define a trusted tool catalogue and ToolManifest. Mark each tool’s operation, side effects, and privilege-affecting parameters.
  2. Instantiate SemanticPolicyCompiler with your pinned manifest. The compiler must only see authenticated user requests and the trusted catalogue.
  3. Create an isolated RuntimeJudge for runtime capability adjudication.
  4. For each authenticated task, the host issues a precise TaskContract, configures TransitionRule, EvidenceStep, and HostToolBinding inside GuardedTransactionNet.
  5. Build a ToolFenceAuthorizationBoundary referencing the trusted catalogue, transaction net, host bindings, actor, reviewer, and policy revision.
  6. All tool calls flow through the semantic monitor and the transaction ledger.

If a complete TaskContract is missing, GuardedBoundary(refine_missing=True) creates a pending RefinementProposal rather than granting access. The host must call review_refinement; after approval, the agent resubits the call. Operations with uncertain outcomes stay reserved until reconciliation.

Important: Controller APIs (issue, configure, ingest, activate, review_refinement, reconcile) are administrative interfaces and must never be exposed as agent tools. Model outputs or tool returns alone are not trusted evidence.

Anonymity Statement

The published package and source tree contain:

Download Tool

Most Popular

View all →

Discover the most used tools by our community.

  • 1

    ghostlock-app

    yukonga/ghostlock-app

    GhostLock One-Tap Execution App (CVE-2026-43499)

    923
  • 2

    OsintHunter

    letox4/osinthunter

    🎯 The ultimate OSINT toolkit: investigation graph, confidence scoring, alias families, map, timeline and reports. 49 modules, 400+ sites, no API keys required.

    923
  • 3

    wifit3

    derv82/wifit3

    Wifite but USB-only & cross-platform.

    694
  • 4

    jumpserver

    jumpserver/jumpserver

    JumpServer is an open-source Privileged Access Management (PAM) platform that provides DevOps and IT teams with on-demand and secure access to SSH, RDP, Kubernetes, Database and RemoteApp endpoints through a web browser.

    463
  • 5

    SafeLine

    chaitin/safeline

    Self-hosted WAF and reverse proxy that filters malicious HTTP traffic, blocks SQL injection, XSS, and bot attacks, with rate limiting and dynamic HTML/JS encryption.

    411
  • 6

    ARTEX

    baarai/artex

    LLM multi-agent autonomous penetration testing platform with planner/worker agents, asset and exploration graphs, MITM traffic recording, and vulnerability retesting.

    390

Explore all tools

Browse our collection of tools

View all tools →