Skip to main content

Victor Contracts

Protocol and type definitions for building Victor verticals without pulling in the Victor runtime.

Overview

Use the contracts package when you want to author or publish a vertical package. Use victor-ai when you want to run a vertical inside the Victor host runtime.

The supported external authoring model is contract-first:

  • vertical packages depend on victor-contracts
  • verticals declare tools, capabilities, prompts, teams, and workflow metadata through the contracts package
  • victor-ai remains responsible for runtime concerns such as agent creation, capability injection, and tool execution

Installation

Contract-only authoring

pip install victor-contracts

Runtime usage

pip install victor-ai

Stable Contract Surface

The core authoring surface is available from the top-level package:

from victor_contracts import (
    CURRENT_DEFINITION_VERSION,
    CapabilityIds,
    CapabilityRequirement,
    ToolNames,
    ToolRequirement,
    VerticalBase,
    VerticalDefinition,
)

Key pieces:

  • VerticalBase: contract base class for external verticals
  • ToolNames: canonical contract-owned tool identifiers
  • CapabilityIds: canonical contract-owned runtime capability identifiers
  • ToolRequirement / CapabilityRequirement: typed requirement declarations
  • VerticalDefinition: validated serializable manifest returned by get_definition()

Quick Start

from victor_contracts import (
    CapabilityIds,
    CapabilityRequirement,
    ToolNames,
    ToolRequirement,
    VerticalBase,
)


class SecurityVertical(VerticalBase):
    name = "security"
    description = "Security analysis and audit workflows"
    version = "1.0.0"

    @classmethod
    def get_name(cls) -> str:
        return cls.name

    @classmethod
    def get_description(cls) -> str:
        return cls.description

    @classmethod
    def get_tool_requirements(cls) -> list[ToolRequirement]:
        return [
            ToolRequirement(ToolNames.READ, purpose="inspect code and configs"),
            ToolRequirement(ToolNames.GREP, purpose="search for vulnerable patterns"),
            ToolRequirement(ToolNames.SHELL, required=False, purpose="run scanners"),
            ToolRequirement(ToolNames.WEB_SEARCH, required=False, purpose="look up CVEs"),
        ]

    @classmethod
    def get_capability_requirements(cls) -> list[CapabilityRequirement]:
        return [
            CapabilityRequirement(
                capability_id=CapabilityIds.FILE_OPS,
                purpose="read repository contents",
            ),
            CapabilityRequirement(
                capability_id=CapabilityIds.WEB_ACCESS,
                optional=True,
                purpose="fetch external security references",
            ),
        ]

    @classmethod
    def get_system_prompt(cls) -> str:
        return "You are a security-focused assistant."

    @classmethod
    def get_prompt_templates(cls) -> dict[str, str]:
        return {
            "audit": "Audit the target for security issues and explain severity."
        }

    @classmethod
    def get_task_type_hints(cls) -> dict[str, dict[str, object]]:
        return {
            "audit": {
                "hint": "Start with read-first reconnaissance, then validate findings.",
                "tool_budget": 12,
                "priority_tools": [ToolNames.READ, ToolNames.GREP, ToolNames.SHELL],
            }
        }

    @classmethod
    def get_team_declarations(cls) -> dict[str, dict[str, object]]:
        return {
            "security_review_team": {
                "name": "Security Review Team",
                "formation": "pipeline",
                "members": [
                    {
                        "role": "researcher",
                        "goal": "Inspect the target and identify likely risks.",
                    },
                    {
                        "role": "reviewer",
                        "goal": "Validate findings before escalation.",
                    },
                ],
            }
        }


definition = SecurityVertical.get_definition()
assert definition.definition_version == "1.0"
assert definition.tools == [ToolNames.READ, ToolNames.GREP, ToolNames.SHELL, ToolNames.WEB_SEARCH]
assert definition.team_metadata.teams[0].team_id == "security_review_team"

Definition Contract

VerticalBase.get_definition() is the preferred contract API. It returns a validated VerticalDefinition manifest that contains:

  • definition_version
  • canonical tool identifiers
  • typed tool and capability requirements
  • system prompt text
  • prompt metadata and task-type hints
  • team metadata such as declarative team layouts and the default team identifier
  • declarative stage definitions
  • workflow metadata such as initial stage, provider hints, and evaluation criteria

Compatibility note:

  • get_config() still exists as a bridge for current victor-ai integrations
  • VerticalDefinition.to_config() / from_config() bridge the legacy config shape
  • VerticalDefinition.from_dict() supports serialized manifest round-tripping

Packaging

Register the vertical via the standard Victor entry point:

[project]
name = "victor-security"
version = "1.0.0"
dependencies = ["victor-contracts>=1.0.0"]

[project.entry-points."victor.plugins"]
security = "victor_security:plugin"

Discovery

Victor discovers external vertical packages through victor.plugins entry points, then each plugin registers one or more contract vertical definitions:

from victor_contracts.discovery import get_global_registry

registry = get_global_registry()
verticals = registry.get_verticals()

Guides And Examples

Testing

pip install -e ".[dev]"
pytest victor-contracts/tests -q

To verify compatibility with the runtime as well:

pip install -e ".[dev]" victor-ai
pytest victor-contracts/tests/unit tests/integration/test_contracts_integration.py -q

Versioning

The package follows semantic versioning, and the manifest contract is versioned separately via VerticalDefinition.definition_version. External verticals should treat the contracts package as the source of truth for supported identifiers and manifest fields.

Per-surface stability tiers and the deprecation policy (warn at least one minor release before removal; removals only in minor bumps) are defined in CONTRACT_STABILITY.md. Releases are recorded in CHANGELOG.md.

Metadata

Release files for victor-contracts 0.9.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for victor-contracts 0.9.2
File Size Uploaded
victor_contracts-0.9.2.tar.gz 127.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for victor-contracts 0.9.2
File Interpreter ABI Platform
victor_contracts-0.9.2-py3-none-any.whl Python 3 none any Details

Total release size: 298.6 kB

Release files / victor_contracts-0.9.2.tar.gz

Download URL victor_contracts-0.9.2.tar.gz
Size 127.7 kB
Tags Source
SHA-256 checksum
How to use checksums
6b764a3a86f8c83b57911ddbf964f92b0e50d5f57497badb7dd7d5a28e59404e
BLAKE2b-256 checksum
How to use checksums
a11821b6bdebbbe3b4794164e132f9d74786ff8a3209ffc479e85774c52914a8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 17, 2026.

Transparency log

Release files / victor_contracts-0.9.2-py3-none-any.whl

Download URL victor_contracts-0.9.2-py3-none-any.whl
Size 170.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
778fd01ba0fed2dddad44d1044d67429e7039b9c07ade8ec4cf608a419c3eee0
BLAKE2b-256 checksum
How to use checksums
ffe7d3b4184744afd2819c18f3733e38e7349359cc4ab0d63ff8165b14a54cff
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 17, 2026.

Transparency log

Release history Release notifications | RSS feed

0.10.0

2 release files

This release

0.9.2 This release

2 release files

0.9.1

2 release files

0.9.0

2 release files

0.7.3

2 release files

0.7.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page