summaryrefslogtreecommitdiff
path: root/src/Agent.Core/Tools
diff options
context:
space:
mode:
authortanaka takashi <isazaka@gmail.com>2026-08-11 21:53:57 +0900
committertanaka takashi <isazaka@gmail.com>2026-08-11 21:53:57 +0900
commit7c9794f8d4d05074b96bb525d19db4ee1f6b3e95 (patch)
treecb8961ee170d9f6874513e8b1a99b06855bb0707 /src/Agent.Core/Tools
parent6c3458a5ec37a5b69957ad17c84de58984698f25 (diff)
Complete runtime diagnostics and verification coverage
Diffstat (limited to 'src/Agent.Core/Tools')
-rw-r--r--src/Agent.Core/Tools/InternalToolDispatcher.cs3
-rw-r--r--src/Agent.Core/Tools/ToolPolicy.cs7
2 files changed, 8 insertions, 2 deletions
diff --git a/src/Agent.Core/Tools/InternalToolDispatcher.cs b/src/Agent.Core/Tools/InternalToolDispatcher.cs
index 0ae078c..c88b92c 100644
--- a/src/Agent.Core/Tools/InternalToolDispatcher.cs
+++ b/src/Agent.Core/Tools/InternalToolDispatcher.cs
@@ -11,7 +11,8 @@ public sealed class InternalToolDispatcher(IToolPolicyEngine policy, IInternalTo
{
InternalToolValidator.Validate(toolName, arguments);
ToolPolicyDecision decision = policy.Evaluate(toolName, arguments);
- if (!decision.Allowed) return new(false, decision.Reason, false, $"policy:{toolName}:{decision.Reason}", RetryAllowed: false);
+ if (!decision.Allowed) return new(false, decision.Reason, false, $"policy:{toolName}:{decision.Reason}", RetryAllowed: false,
+ ErrorCode: "policy.tool_denied", ErrorCategory: "policy", Resolution: "Review the enabled Internal Tool policy.");
return await backend.ExecuteAsync(taskId, toolName, arguments, cancellationToken).ConfigureAwait(false);
}
}
diff --git a/src/Agent.Core/Tools/ToolPolicy.cs b/src/Agent.Core/Tools/ToolPolicy.cs
index cefca8d..66f63ab 100644
--- a/src/Agent.Core/Tools/ToolPolicy.cs
+++ b/src/Agent.Core/Tools/ToolPolicy.cs
@@ -25,7 +25,12 @@ public sealed record ToolExecutionResult(
string Output,
bool ExternalEffect,
string? FailureFingerprint = null,
- bool RetryAllowed = true);
+ bool RetryAllowed = true,
+ string? ErrorCode = null,
+ string? ErrorCategory = null,
+ string? TargetPath = null,
+ string? RequiredPermission = null,
+ string? Resolution = null);
public sealed class DenyByDefaultPolicy(IReadOnlySet<string>? allowedTools = null) : IToolPolicyEngine
{