What are Policies in OVADARE?

Policies are the foundation of OVADARE’s conflict detection and resolution system. They define the rules and boundaries that guide agent behaviors and interactions, ensuring collaboration stays within predefined constraints.


Why Use Policies?

  • Prevent Conflict: Set clear expectations to avoid potential agent conflicts.
  • Ensure Compliance: Maintain adherence to organizational rules and workflows.
  • Dynamic Control: Adapt policies dynamically to fit evolving needs.

Defining Policies

In OVADARE, policies are defined as sets of rules that agents must follow. These rules are evaluated during agent actions to detect violations.

from ovadare.policies.policy_manager import Policy, PolicyManager

# Define a policy
read_policy = Policy(
    name="ReadOnlyPolicy",
    rules={
        "access_level": "read",
        "resource_restriction": ["confidential_files"]
    }
)

# Initialize the Policy Manager
policy_manager = PolicyManager()

# Add the policy
policy_manager.add_policy(read_policy)
print(f"Policy added: {read_policy.name}")

Evaluating Policies

When agents perform actions, their activities are evaluated against the defined policies. If an action violates a policy, a conflict is triggered.

from ovadare.policies.policy_manager import PolicyManager

# Simulate an action
action = {
    "agent_id": "agent_X",
    "action": "edit_document",
    "resource": "confidential_files"
}

# Evaluate the action
evaluation_result = policy_manager.evaluate_policies(action)
if not evaluation_result.is_compliant:
    print(f"Conflict detected: {evaluation_result.message}")

Example: Creating Custom Policies

You can create tailored policies for specific workflows. For example:

  1. Access Control Policies: Restrict agent access to sensitive resources.
  2. Task Prioritization Policies: Define task execution priorities for agents.
  3. Interaction Rules: Limit certain types of agent interactions.
from ovadare.policies.policy_manager import Policy

# Define a custom policy
interaction_policy = Policy(
    name="InteractionPolicy",
    rules={
        "allowed_agents": ["agent_A", "agent_B"],
        "interaction_limit": 5
    }
)

policy_manager.add_policy(interaction_policy)

Managing Policies

The Policy Manager is the central component for managing policies in OVADARE. It allows you to:

  • Add and remove policies.
  • Update existing policies dynamically.
  • Retrieve the list of active policies.
# Retrieve active policies
active_policies = policy_manager.get_all_policies()
print("Active policies:", [policy.name for policy in active_policies])

Learn More