Skip to content

API Reference parrot_tools.security.soc2_advisory

github-actions[bot] edited this page Dec 2, 2026 · 4 revisions

parrot_tools.security.soc2_advisory

View source

SOC2AdvisoryToolkit — LLM-facing read-only SOC2 advisory tools.

Wraps SecurityAdvisoryEngine and the existing ComplianceMapper as agent-callable tools. All tools return structured dicts; narrative is left to the caller's LLM. The store is required; the toolkit is strictly read-only (never calls save_report or any write path).

Implements FEAT-226 spec §3 Module 2.

Alias AbstractToolkit

Re-exported from parrot_tools.toolkit.AbstractToolkit.

Alias ComplianceFramework

Re-exported from parrot_tools.security.models.ComplianceFramework.

Alias ComplianceMapper

Re-exported from parrot_tools.security.reports.ComplianceMapper.

Class SOC2AdvisoryToolkit

LLM-facing tools for SOC2-oriented security advisory.

Provides three read-only tools (soc2_ prefix):

  • soc2_map_report_to_soc2 — map a stored report's findings to SOC2 controls via ComplianceMapper.get_findings_by_control.
  • soc2_soc2_gap_analysis — coverage + unmapped findings from the latest SCAN report for a framework.
  • soc2_daily_soc2_advisory — day-over-day diff advisory via SecurityAdvisoryEngine.build_daily_advisory.

All tools return JSON-serialisable dicts. On error they return {"error": "...", "hint": "..."} and never raise to the LLM.

Parameter Type Default Description
report_store SecurityReportStore Required catalog backend (read-only).
mapper ComplianceMapper | None None Optional ComplianceMapper; a fresh default instance is created when not provided.
**kwargs {} Forwarded to AbstractToolkit.__init__.

Attributes:

Attribute Type Description
tool_prefix str

Method SOC2AdvisoryToolkit.map_report_to_soc2

Map findings from a stored report to SOC2 Trust Service Criteria.

Fetches the report, parses its findings, and groups them by SOC2 control ID using ComplianceMapper.get_findings_by_control. Also returns overall SOC2 coverage metrics.

map_report_to_soc2(report_id: str) -> dict

Parameter Type Default Description
report_id str UUID string of the stored report to analyse.

Returns: dict — Dict with keys:

  • control_findings: mapping of control_id → list of finding summaries.
  • coverage: SOC2 coverage metrics dict from ComplianceMapper.get_framework_coverage.
  • report_id: the analysed report UUID string. On error: {"error": "...", "hint": "..."}.

Method SOC2AdvisoryToolkit.soc2_gap_analysis

Analyse SOC2 coverage gaps from the latest report for a framework.

Queries the most-recent SCAN report and returns:

  • SOC2 coverage metrics (what % of controls were checked).
  • List of unmapped findings (findings with no SOC2 control mapping).

soc2_gap_analysis(framework: str = 'soc2') -> dict

Parameter Type Default Description
framework str 'soc2' Compliance framework to analyse. Defaults to "soc2" — the primary framework for this toolkit.

Returns: dict — Dict with keys:

  • coverage: coverage metrics from ComplianceMapper.get_framework_coverage.
  • unmapped_findings: list of finding summaries with no SOC2 control mapping.
  • framework: the framework analysed. On error: {"error": "...", "hint": "..."}.

Method SOC2AdvisoryToolkit.daily_soc2_advisory

Produce a day-over-day SOC2 advisory for a framework.

Delegates to SecurityAdvisoryEngine.build_daily_advisory and returns the AdvisoryReport as a JSON-serialisable dict.

daily_soc2_advisory(framework: str = 'soc2', provider: str = 'aws') -> dict

Parameter Type Default Description
framework str 'soc2' Compliance framework identifier. Defaults to "soc2".
provider str 'aws' Cloud provider. Defaults to "aws".

Returns: dict — JSON-serialisable dict of AdvisoryReport.model_dump. On error: {"error": "...", "hint": "..."}.

Alias SecurityAdvisoryEngine

Re-exported from parrot_tools.security.advisory_engine.SecurityAdvisoryEngine.

Architecture

Clients

Bots & Agents

Memory

Knowledge

Tools & Toolkits

Flows

Experts

Skills

Stores & Loaders

MCP & A2A

Server & APIs

Integrations

Outputs & A2UI

Prompts

Security

Operations

Migration

SDD Tooling

LLM Wiki

Deployment

Decisions

API Reference

Clone this wiki locally