Skip to content

feat(agent): add versioned knowledge pack and knowledge_lookup tool - #522

Open
BaaRai wants to merge 2 commits into
mainfrom
feat/knowledge-pack
Open

BaaRai wants to merge 2 commits into
mainfrom
feat/knowledge-pack

Conversation

@BaaRai

@BaaRai BaaRai commented Nov 24, 2026

Copy link
Copy Markdown
Owner

What

Adds a small, versioned security taxonomy pack and a read-only knowledge_lookup tool for the planner and the workers.

  • knowledge/: MITRE ATT&CK Enterprise (706 techniques), OWASP WSTG (133 tests), MITRE CWE (956 weaknesses). Each entry has an id, name, category, a capped description, a truncated flag and the canonical URL.
  • knowledge/data/sources.json: source URL, license, retrieval date, source SHA-256 and entry count for each file.
  • knowledge/NOTICE and knowledge/licenses/: attribution and the license texts. The data files keep their own licenses; the repository's AGPL-3.0 covers the code.
  • scripts/knowledge/build.py: regenerates the pack from the official sources.
  • agent/knowledge_tool.go: the knowledge_lookup tool (source, query, optional limit; exact id or keywords; max 20). It is advertised to the planner and the workers.
  • .dockerignore: only the top-level /data runtime directory is excluded, so knowledge/data stays in the build context.

Why

The planner and the workers plan in free text. Stable ids let a finding or a fact cite CWE-79, T1190 or WSTG-ATHN-01, which is the base for coverage checks, finding enrichment and RSI lessons. A large community corpus was evaluated and rejected: most of it is benchmark tarballs and duplicates, and the rest has unclear redistribution rights. This pack is built from the primary sources instead.

Tests

  • go test ./knowledge (load, exact lookup, keyword search, limit, errors, duplicate ids)
  • go test ./agent -run TestKnowledge (tool output, limit clamp, errors, read-only)
  • go build ./...
  • go vet ./knowledge ./agent
  • gofmt -l on the new files

The Docker build stage was not built locally because the Docker daemon is off. The .dockerignore change keeps knowledge/data in the context and go build ./... covers the embed.

Limits

Closes #521.

Embed MITRE ATT&CK, OWASP WSTG and MITRE CWE ids, names, categories and
capped descriptions generated by scripts/knowledge/build.py. The pack records
the source URL, license, retrieval date and SHA-256; the license texts and
attribution live in knowledge/NOTICE and knowledge/licenses.

Expose a read-only knowledge_lookup tool to the planner and the workers so an
agent can resolve an entry by id or keyword and cite the id in findings and
facts. The data files keep their own licenses; the repository's AGPL-3.0
covers the code.

Refs #521.
knowledge_lookup takes a taxonomy id or keyword, never a connection. Add it to
the intercept noTargetTools list so the target gate does not read targets from
its query. TestDomainToolsDeclareNoTarget now covers the new domain tool.

Refs #521.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a versioned knowledge pack and a knowledge_lookup tool (ATT&CK, WSTG, CWE)

1 participant