Files
probo/pkg/vetting/sub_agent_specs.go
Sacha Al Himdani eecbe4c46c Rename vendors to third parties
Renames the user-facing 'vendor' concept to 'third party' across the
entire codebase. The shared common_third_parties reference table is
unchanged.

Migration. Renames the vendor_category enum, the vendors and
vendor_<entity> tables (contacts, services, compliance_reports,
business_associate_agreements, data_privacy_agreements,
risk_assessments) and their vendor_id columns, the asset_vendors /
data_vendors / processing_activity_vendors junction tables,
generated_documents.vendors_document_id, the webhook_event_type
'vendor:<verb>' values, and the snapshots_type 'VENDORS' value.

Backend. Renames coredata models and SQL queries, probo services,
GraphQL / MCP API surface, console / trust / webhook resolvers and
types, the CLI (prb vendor* -> prb third-party*; pkg/cmd/vendormgmt
-> pkg/cmd/thirdpartymgmt), the document generator, vetting agent
prompts, and the common-third-parties-import command.

Frontend, packages, n8n, e2e. Renames apps/console pages, components,
hooks, routes, dialogs, and tabs; the shared @probo/vendors package
(now @probo/third-parties); the @probo/ui Vendors atoms (now
ThirdParties, VendorLogo -> ThirdPartyLogo); the n8n community node
actions/vendor folder (now actions/thirdParty); and the e2e Go test
suite (console and MCP). Filesystem and URL paths use kebab-case
(third-parties), GraphQL fields and TypeScript identifiers use
camelCase (thirdParty / thirdParties), Go types use PascalCase
(ThirdParty), and human-facing text uses 'third party' with a space.

Co-authored-by: Bryan Frimin <bryan@getprobo.com>
Signed-off-by: Bryan Frimin <bryan@getprobo.com>
Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
2026-05-13 21:21:39 +02:00

234 lines
7.6 KiB
Go

// Copyright (c) 2026 Probo Inc <hello@getprobo.com>.
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
// copyright notice and this permission notice appear in all copies.
//
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
// AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
// OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
// PERFORMANCE OF THIS SOFTWARE.
package vetting
import _ "embed"
// Specs for every vetting sub-agent. The orchestrator passes each spec
// to newSubAgent[T] together with the structured output type and the
// tool set the agent should use.
//
// Tuning notes:
// - thinkingBudget=4000 is enabled on agents that need to reason over
// multiple documents (analyzer, ai_risk, data_processing, business
// continuity, incident response, regulatory compliance). The agent
// runtime delays structured output enforcement until a dedicated
// synthesis turn (run.go), so thinking no longer conflicts with the
// JSON schema during tool exploration.
// - parallelTools=true is enabled on agents that issue many independent
// tool calls per turn (security_assessor, market, code_security,
// financial_stability, web_search, regulatory_compliance).
// - maxTurns is sized to give the agent enough room for tool calls plus
// a few retries; subprocessor extraction needs the most because of
// paginated subprocessor lists.
var (
//go:embed prompts/crawler.txt
crawlerPrompt string
//go:embed prompts/analyzer.txt
analyzerPrompt string
//go:embed prompts/security.txt
securityPrompt string
//go:embed prompts/compliance.txt
compliancePrompt string
//go:embed prompts/market.txt
marketPrompt string
//go:embed prompts/subprocessor.txt
subprocessorPrompt string
//go:embed prompts/data_processing.txt
dataProcessingPrompt string
//go:embed prompts/ai_risk.txt
aiRiskPrompt string
//go:embed prompts/incident_response.txt
incidentResponsePrompt string
//go:embed prompts/business_continuity.txt
businessContinuityPrompt string
//go:embed prompts/professional_standing.txt
professionalStandingPrompt string
//go:embed prompts/regulatory_compliance.txt
regulatoryCompliancePrompt string
//go:embed prompts/websearch.txt
websearchPrompt string
//go:embed prompts/financial_stability.txt
financialStabilityPrompt string
//go:embed prompts/code_security.txt
codeSecurityPrompt string
//go:embed prompts/third_party_comparison.txt
thirdPartyComparisonPrompt string
)
var (
crawlerAgentSpec = subAgentSpec{
name: "website_crawler",
outputName: "crawler_output",
prompt: crawlerPrompt,
maxTurns: 40,
}
analyzerAgentSpec = subAgentSpec{
name: "document_analyzer",
outputName: "document_analysis_output",
prompt: analyzerPrompt,
maxTurns: 20,
thinkingBudget: 4000,
}
securityAgentSpec = subAgentSpec{
name: "security_assessor",
outputName: "security_output",
prompt: securityPrompt,
maxTurns: 32,
parallelTools: true,
}
complianceAgentSpec = subAgentSpec{
name: "compliance_assessor",
outputName: "compliance_output",
prompt: compliancePrompt,
maxTurns: 20,
}
marketAgentSpec = subAgentSpec{
name: "market_presence_analyst",
outputName: "market_output",
prompt: marketPrompt,
maxTurns: 40,
parallelTools: true,
}
subprocessorAgentSpec = subAgentSpec{
name: "subprocessor_extractor",
outputName: "subprocessor_output",
prompt: subprocessorPrompt,
maxTurns: 100,
}
dataProcessingAgentSpec = subAgentSpec{
name: "data_processing_assessor",
outputName: "data_processing_output",
prompt: dataProcessingPrompt,
maxTurns: 28,
thinkingBudget: 4000,
}
aiRiskAgentSpec = subAgentSpec{
name: "ai_risk_assessor",
outputName: "ai_risk_output",
prompt: aiRiskPrompt,
maxTurns: 28,
thinkingBudget: 4000,
}
incidentResponseAgentSpec = subAgentSpec{
name: "incident_response_assessor",
outputName: "incident_response_output",
prompt: incidentResponsePrompt,
maxTurns: 28,
thinkingBudget: 4000,
}
businessContinuityAgentSpec = subAgentSpec{
name: "business_continuity_assessor",
outputName: "business_continuity_output",
prompt: businessContinuityPrompt,
maxTurns: 28,
thinkingBudget: 4000,
}
professionalStandingAgentSpec = subAgentSpec{
name: "professional_standing_assessor",
outputName: "professional_standing_output",
prompt: professionalStandingPrompt,
maxTurns: 28,
}
regulatoryComplianceAgentSpec = subAgentSpec{
name: "regulatory_compliance_assessor",
outputName: "regulatory_compliance_output",
prompt: regulatoryCompliancePrompt,
maxTurns: 40,
thinkingBudget: 4000,
parallelTools: true,
}
websearchAgentSpec = subAgentSpec{
name: "web_search_analyst",
outputName: "web_search_output",
prompt: websearchPrompt,
maxTurns: 40,
parallelTools: true,
}
financialStabilityAgentSpec = subAgentSpec{
name: "financial_stability_assessor",
outputName: "financial_stability_output",
prompt: financialStabilityPrompt,
maxTurns: 40,
parallelTools: true,
}
codeSecurityAgentSpec = subAgentSpec{
name: "code_security_assessor",
outputName: "code_security_output",
prompt: codeSecurityPrompt,
maxTurns: 40,
parallelTools: true,
}
thirdPartyComparisonAgentSpec = subAgentSpec{
name: "third_party_comparison_assessor",
outputName: "third_party_comparison_output",
prompt: thirdPartyComparisonPrompt,
maxTurns: 40,
}
)
// Per-output-type builders. Defining them here lets the orchestrator hold
// a slice of (toolName, description, tools, builder) entries instead of
// embedding a closure with an explicit type parameter at every call site.
var (
buildCrawlerAgent = buildFor[CrawlerOutput](crawlerAgentSpec)
buildAnalyzerAgent = buildFor[DocumentAnalysisOutput](analyzerAgentSpec)
buildSecurityAgent = buildFor[SecurityOutput](securityAgentSpec)
buildComplianceAgent = buildFor[ComplianceOutput](complianceAgentSpec)
buildMarketAgent = buildFor[MarketOutput](marketAgentSpec)
buildSubprocessorAgent = buildFor[SubprocessorOutput](subprocessorAgentSpec)
buildDataProcessingAgent = buildFor[DataProcessingOutput](dataProcessingAgentSpec)
buildAIRiskAgent = buildFor[AIRiskOutput](aiRiskAgentSpec)
buildIncidentResponseAgent = buildFor[IncidentResponseOutput](incidentResponseAgentSpec)
buildBusinessContinuityAgent = buildFor[BusinessContinuityOutput](businessContinuityAgentSpec)
buildProfessionalStandingAgent = buildFor[ProfessionalStandingOutput](professionalStandingAgentSpec)
buildRegulatoryComplianceAgent = buildFor[RegulatoryComplianceOutput](regulatoryComplianceAgentSpec)
buildWebsearchAgent = buildFor[WebSearchOutput](websearchAgentSpec)
buildFinancialStabilityAgent = buildFor[FinancialStabilityOutput](financialStabilityAgentSpec)
buildCodeSecurityAgent = buildFor[CodeSecurityOutput](codeSecurityAgentSpec)
buildThirdPartyComparisonAgent = buildFor[ThirdPartyComparisonOutput](thirdPartyComparisonAgentSpec)
)