picoclaw/pkg/agent
uiyzzi 16d23d8cdc feat(security): add sensitive data filtering for tool results sent to
LLM

Prevent LLM from seeing its own credentials (API keys, tokens, secrets)
by filtering sensitive values from tool call results before sending to
the
model. Values are collected from .security.yml and replaced with
[FILTERED] using an efficient strings.Replacer (O(n+m)).

- Add FilterSensitiveData and FilterMinLength to ToolsConfig
- Implement SensitiveDataReplacer() with sync.Once caching in
  SecurityConfig
- Use reflection to collect all sensitive values (Model API keys,
  channel
  tokens, web tool API keys, skills tokens)
- Apply filtering in agent loop at 4 tool result locations
- Add comprehensive tests covering all token types
2026-03-23 20:55:41 +08:00
..
context.go fix(provider): deduplicate tool results and merge consecutive tool_result blocks for Anthropic API (#1793) 2026-03-23 17:24:46 +08:00
context_budget.go merge: resolve conflicts between refactor/agent and main 2026-03-22 19:21:58 +08:00
context_budget_test.go merge: resolve conflicts between refactor/agent and main 2026-03-22 19:21:58 +08:00
context_cache_test.go merge: resolve conflicts between refactor/agent and main 2026-03-22 19:21:58 +08:00
context_test.go fix(provider): deduplicate tool results and merge consecutive tool_result blocks for Anthropic API (#1793) 2026-03-23 17:24:46 +08:00
definition.go merge: resolve conflicts between refactor/agent and main 2026-03-22 19:21:58 +08:00
definition_test.go merge: resolve conflicts between refactor/agent and main 2026-03-22 19:21:58 +08:00
eventbus.go merge: resolve conflicts between refactor/agent and main 2026-03-22 19:21:58 +08:00
eventbus_test.go Merge branch 'main' into version 2026-03-23 10:54:08 +08:00
events.go merge: resolve conflicts between refactor/agent and main 2026-03-22 19:21:58 +08:00
hook_mount.go merge: resolve conflicts between refactor/agent and main 2026-03-22 19:21:58 +08:00
hook_mount_test.go Merge branch 'main' into version 2026-03-23 10:54:08 +08:00
hook_process.go merge: resolve conflicts between refactor/agent and main 2026-03-22 19:21:58 +08:00
hook_process_test.go merge: resolve conflicts between refactor/agent and main 2026-03-22 19:21:58 +08:00
hooks.go merge: resolve conflicts between refactor/agent and main 2026-03-22 19:21:58 +08:00
hooks_test.go Merge branch 'main' into version 2026-03-23 10:54:08 +08:00
instance.go merge: resolve conflicts between refactor/agent and main 2026-03-22 19:21:58 +08:00
instance_test.go Merge branch 'main' into version 2026-03-22 02:53:55 +08:00
loop.go feat(security): add sensitive data filtering for tool results sent to 2026-03-23 20:55:41 +08:00
loop_mcp.go feat(mcp): per server deferred mode (#1654) 2026-03-19 17:03:17 +08:00
loop_mcp_test.go feat(mcp): per server deferred mode (#1654) 2026-03-19 17:03:17 +08:00
loop_media.go feat: expose local file paths for non-image media to enable agent file tools (#1516) 2026-03-14 12:09:11 +08:00
loop_test.go Use ModelName instead of Model in test config structs 2026-03-23 16:47:13 +08:00
memory.go refactor(modernize): apply safe modernize fixes 2026-02-27 16:35:07 +08:00
mock_provider_test.go feat(fmt): Fix formatting 2026-02-19 22:05:15 +02:00
model_resolution.go fix(agent): rebind provider after /switch model to (#1769) 2026-03-19 21:44:01 +08:00
registry.go feat(session): integrate JSONL persistence into agent loop (#1170) 2026-03-10 15:14:09 +08:00
registry_test.go refactor Config to add Version and migratable 2026-03-12 13:52:55 +08:00
steering.go fix(agent): fix subturn panic result, hard abort rollback, and drain bus exit 2026-03-22 20:35:14 +08:00
steering_test.go Merge branch 'main' into version 2026-03-23 10:54:08 +08:00
subturn.go fix(agent): fix subturn panic result, hard abort rollback, and drain bus exit 2026-03-22 20:35:14 +08:00
subturn_test.go Merge branch 'main' into version 2026-03-23 10:54:08 +08:00
thinking.go feat: add extended thinking support for Anthropic models (#1076) 2026-03-05 09:51:18 +08:00
thinking_test.go feat: add extended thinking support for Anthropic models (#1076) 2026-03-05 09:51:18 +08:00
turn.go merge: resolve conflicts between refactor/agent and main 2026-03-22 19:21:58 +08:00