Rueckmeldung nach Vertrauensstufe: drei Wege nach oben (#715)

- IAgentTool.ReadsForeignContent: Werkzeuge mit Aussenkontakt erklaeren sich selbst
  (WebFetch, WebMonitor, DirectAPI, Mail, RocketChat, Telegram, TelegramClient,
  SocialMediaManager, FTP, Database); AgentConfig.TreatAsForeignReader kann nur verschaerfen
- ReportingLine: Stufe aus den Werkzeugen, "wer steht darueber", Pruefung des Wegs nach oben
  (nie Aenderungen an Aufgaben darueber, nur eine Ebene hoch, Fremdinhalt-Stufe gar kein
  Freitext) und Rahmung als untrusted_content
- Engine: Nachricht und Spawn nach oben geprueft, Text der Fremdinhalt-Stufe kommt gerahmt an
- Taskboard: task_create/update/comment, reopen und die Dubletten-Notiz folgen dem Berichtsweg
- Dispatcher: Aufgaben von Agenten der Fremdinhalt-Stufe gehen gerahmt in den Lauf
- TaskReports: Erledigt-Signal und Systemmeldung (in Pruefung, blockiert, abgebrochen) an den
  Auftraggeber, je Zustand einmal, gesammelt in einer offenen Aufgabe je Empfaenger
- OrgBriefing nennt den Berichtsweg; WebUI zeigt Stufe und Schalter am Agenten

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Richard
2026-09-25 09:16:29 +02:00
co-authored by Claude Opus 5.5
parent e2ffe4b380
commit 3857a7cab2
33 changed files with 1234 additions and 30 deletions
+5 -2
View File
@@ -52,14 +52,17 @@ public sealed record AgentDto(
decimal DailyCostUsd,
long DailyTokens,
bool IsRunning,
IReadOnlyList<AgentToolDto> Tools);
IReadOnlyList<AgentToolDto> Tools,
// #715: What makes the agent read foreign content — its tools, or "setting". Empty: standard tier.
IReadOnlyList<string> ForeignContentSources,
bool TreatAsForeignReader);
/// <summary>
/// Ein Werkzeug am Agenten. <b>Ohne die Einstellungen</b> — die stehen in einem freien
/// Wörterbuch und enthalten regelmäßig Passwörter und Schlüssel. Was einstellbar ist und
/// ob etwas gesetzt ist, sagt <see cref="ToolSettingsDto"/>.
/// </summary>
public sealed record AgentToolDto(string Name, string Description, bool Enabled);
public sealed record AgentToolDto(string Name, string Description, bool Enabled, bool ReadsForeignContent = false);
/// <summary>
/// Die Einstellungen eines Werkzeugs, maskiert.
+7 -3
View File
@@ -20,7 +20,8 @@ internal static class Mapping
public static AgentDto ToDto(
this AgentConfig agent,
IReadOnlyDictionary<string, string> toolDescriptions,
bool isRunning)
bool isRunning,
Func<string, Core.Tools.IAgentTool?>? tools = null)
=> new(
agent.AgentId,
agent.DisplayName,
@@ -38,8 +39,11 @@ internal static class Mapping
.Select(name => new AgentToolDto(
name,
toolDescriptions.GetValueOrDefault(name) ?? "",
agent.Tools.ContainsKey(name)))
.ToList());
agent.Tools.ContainsKey(name),
tools?.Invoke(name)?.ReadsForeignContent == true))
.ToList(),
tools is null ? [] : Core.Organisation.ReportingLine.TrustOf(agent, tools).Sources,
agent.TreatAsForeignReader);
/// <summary>
/// Die Einstellungen eines Werkzeugs — <b>ohne die Geheimnisse</b>.
@@ -99,7 +99,7 @@ internal static class ApiEndpoints
var descriptions = host.AgentAdmin.ToolDescriptions();
return host.AgentAdmin.All
.Select(a => a.ToDto(descriptions, host.Engine?.IsRunning(a.AgentId) ?? false))
.Select(a => a.ToDto(descriptions, host.Engine?.IsRunning(a.AgentId) ?? false, host.Tools.Get))
.ToList();
});
@@ -122,7 +122,8 @@ internal static class ApiEndpoints
host.AgentAdmin.Find(agentId) is { } agent
? Results.Ok(agent.ToDto(
host.AgentAdmin.ToolDescriptions(),
host.Engine?.IsRunning(agent.AgentId) ?? false))
host.Engine?.IsRunning(agent.AgentId) ?? false,
host.Tools.Get))
: Results.NotFound(new OutcomeDto(false, $"Kein Agent mit der ID '{agentId}'.")));
agents.MapPost("/", (AppHost host, NewAgentDto input) =>
@@ -132,6 +133,10 @@ internal static class ApiEndpoints
agents.MapDelete("/{agentId}", (AppHost host, string agentId) =>
host.AgentAdmin.Remove(agentId).ToResponse());
// #715: Can only tighten — the tools decide the tier, this adds to it.
agents.MapPut("/{agentId}/foreign-reader", (AppHost host, string agentId, bool value) =>
host.AgentAdmin.SetTreatAsForeignReader(agentId, value).ToResponse());
agents.MapPut("/{agentId}/tools/{toolName}", (
AppHost host, string agentId, string toolName, bool enabled) =>
host.AgentAdmin.SetToolEnabled(agentId, toolName, enabled).ToResponse());