Use this file to discover all available pages before exploring further.
Agency Swarm is a multi-agent orchestration framework built around role-based agents and tool-calling. Vaultak plugs into two integration points it exposes natively.
Input & Output Guardrails
Risk-score incoming messages and mask PII in agent responses using Agency Swarm’s native guardrail decorators.
BaseTool Mixin
Intercept individual tool calls before they execute by mixing Vaultak checks into any BaseTool subclass.
For per-tool risk scoring, subclass BaseTool through the VaultakMixin. The mixin intercepts run(), calls Vaultak before execution, and masks PII in string outputs afterward.
import osfrom typing import Anyfrom agency_swarm.tools import BaseToolfrom pydantic import Fieldfrom vaultak import Vaultakvt = Vaultak(api_key=os.environ["VAULTAK_API_KEY"], agent_name="agency-swarm-agent")RISK_THRESHOLD = 7.0class VaultakMixin: def run(self) -> Any: tool_name = self.__class__.__name__ args = self.model_dump() # type: ignore[attr-defined] result = vt.score_action(action=tool_name, context=args) if result.score >= RISK_THRESHOLD: raise RuntimeError( f"[Vaultak] '{tool_name}' blocked — risk score {result.score:.1f}/10. " "Review at app.vaultak.com" ) vt.check_policy(tool_name=tool_name, input_data=str(args)) output = super().run() # type: ignore[misc] return vt.mask_pii(output) if isinstance(output, str) else outputclass LookupCustomer(VaultakMixin, BaseTool): """Look up a customer record by ID.""" customer_id: str = Field(..., description="The customer ID to look up.") def run(self) -> str: return f"Customer {self.customer_id}: Alice Smith, alice@example.com"
Inherit VaultakMixinbeforeBaseTool so Python’s MRO calls VaultakMixin.run() first, then chains to your tool’s run() via super().