Policies¶
A policy is a small piece of Python code that AIOS loads and runs at a decision point, so you can customize how the system behaves. Instead of hard-coding rules such as "how to scale", "where to place a block" or "who may join", AIOS asks a policy. This makes it a general-purpose platform: you decide the rules.
At a glance
Who this is for: anyone customizing AIOS: network and cluster admins, block and vDAG creators.
You'll learn: how to write a policy, register it, run it in five different ways, and manage it through the Policies System APIs.
Where policies are used¶
| Area | Policy | Decides | Docs |
|---|---|---|---|
| Governance | Pre-check policies | Whether an action (add a node, create a block, ...) may proceed | Gateway, Cluster Controller |
| Placement | Cluster allocator, resource allocator | Which cluster, node and GPUs a block uses | Block spec |
| Runtime | Load balancer, auto-scaler, health checker | Which instance serves a task; when to scale; how to react to failures | Block runtime |
| Cluster health | Stability checker | Whether the cluster is stable | Cluster Controller |
| Workflows | Assignment, pre/post-processing | Which block serves a vDAG node; how data is transformed between steps | vDAG spec |
| Workflow serving | Quota, quality, health | Usage limits; output audits; block health | vDAG controller |
| Specifications | Template parser | Custom specification formats | Template store |
| Search | Ranking / search policies | Which block or cluster best matches a query | Search and filter |
| Events and failures | Event and failure policies | How to react to block events and failures | Block events, Failure policy executor |
Policy structure¶
Every policy is a Python class named AIOSv1PolicyRule with three methods:
class AIOSv1PolicyRule:
def __init__(self, rule_id, settings, parameters):
"""
Called once when the policy is loaded.
Args:
rule_id (str): Unique identifier for the rule.
settings (dict): Configuration settings for the rule.
parameters (dict): Parameters defining the rule's behavior.
"""
self.rule_id = rule_id
self.settings = settings
self.parameters = parameters
def eval(self, parameters, input_data, context):
"""
Called every time a decision is needed.
Args:
parameters (dict): The current parameters.
input_data (any): The input to evaluate (depends on where the policy is used).
context (dict): An external cache for keeping state across runs.
Returns:
dict: The decision (format depends on where the policy is used).
"""
# Rule logic goes here (it may modify input_data)
return {}
def management(self, action: str, data: dict) -> dict:
"""
Handles custom management commands, for example to update settings or
parameters, read internal state, or run diagnostics.
Args:
action (str): The management action to execute.
data (dict): Input payload or command arguments.
Returns:
dict: A result with the status and any relevant details.
"""
# Implement custom management actions here
return {}
| Concept | Meaning |
|---|---|
| Settings | Configuration fixed when the policy is set up, such as an API URL. |
| Parameters | Values that can change between calls, such as thresholds or allowlists. |
input_data |
What the policy is asked to decide about. Its shape depends on where the policy is used; each reference page lists it. |
context |
A cache for keeping state between calls. |
Five ways to run a policy¶
The same policy code can run in five ways, depending on how heavy it is and whether it must keep state.
| Type | How it runs | Keeps state? | How you talk to it | Scaling | Fault tolerance |
|---|---|---|---|---|---|
| Type 1: In-process | Loaded into another service's own process using the local policy SDK. | Up to the host app | In-process memory | Up to the host app | Same as the host app |
| Type 2: Central executor | Sent to a policy executor, which runs it and returns the result. | No | REST over HTTP | Executor can scale | Same as the executor |
| Type 3: Remote job | Runs once as a Kubernetes Job on a cluster with a policy executor. | No | None while running: wait for the result | Not applicable | Kubernetes |
| Type 4: Online function | Deployed as a long-running pod, initialized once, called many times. | Yes | REST over HTTP | Autoscaling set at creation | Kubernetes |
| Type 5: Policy graph | A stored DAG of Type 4 functions, run by graph URI. | Yes, per node | Orchestrated by the Policies System | Per node | Kubernetes |
More about each type
Type 1: in-process. Any service using the local policy SDK can download a policy's code and run it inside its own process to extend its behavior. The host application controls when the policy is loaded and unloaded, and whether it keeps state. Most built-in AIOS services (load balancer, auto-scaler, controllers) run policies this way. See Run a policy.
Type 2: central executor. Applications call a policy executor through the Policies System APIs. The executor runs the policy with its own CPU and memory, then evicts it. Anyone can deploy their own executor. Stateless only; for stateful remote policies, use Type 4. See Executor APIs.
Type 3: remote job. Runs a policy once as a Kubernetes Job on a cluster that has a registered executor. Useful for heavy one-off work, or for collecting data about that cluster, such as metrics, resources or node health. Stateless. See Job APIs.
Type 4: online function. Deploys a policy as a long-running service, exposed through the Policies System and called over REST. It keeps state between calls, and autoscaling can be configured. See Function APIs.
Type 5: policy graph. A static DAG whose nodes are Type 4 functions. Graphs are stored in a registry, searchable, and run by graph URI. Each node can scale independently. See Graph APIs.
Architecture¶
The Policies System is the set of databases, services and executors that makes all five execution types work, and lets people register, find and run policies and executors.

(Download the architecture diagram)
On the management cluster it is served by policies-system (internal port 10000, NodePort 30102). Below, <policy-system-url> refers to this address.
Preparing policy for onboarding¶
This walkthrough creates a policy that checks whether an IP address is allowed, using a local list plus a list fetched from an external API. It also supports management commands to update the list and inspect its state.
1. Write the policy¶
Save as code/function.py. The file must be named function.py.
import requests
import logging
class AIOSv1PolicyRule:
def __init__(self, rule_id, settings, parameters):
"""
settings = {
"allowlist_api": "https://example.com/api/allowlist"
}
parameters = {
"local_allowlist": ["127.0.0.1"]
}
"""
self.allowlist_cache = []
self.settings = settings
self.parameters = parameters
def fetch_remote_allowlist(self):
try:
response = requests.get(self.settings["allowlist_api"])
response.raise_for_status()
data = response.json()
return data.get("allowlist", [])
except Exception as e:
logging.error(f"Failed to fetch remote allowlist: {e}")
return []
def eval(self, parameters, input_data, context):
ip = input_data.get("ip")
if not ip:
return {"allowed": False, "reason": "IP missing in input_data", "input_data": input_data}
# Merge local and remote allowlists
local = parameters.get("local_allowlist", [])
if not self.allowlist_cache:
self.allowlist_cache = self.fetch_remote_allowlist()
full_allowlist = set(local + self.allowlist_cache)
allowed = ip in full_allowlist
return {
"allowed": allowed,
"input_data": input_data,
"reason": "allowed" if allowed else "denied"
}
def management(self, action: str, data: dict) -> dict:
if action == "update_local_allowlist":
new_ips = data.get("ips", [])
if not isinstance(new_ips, list):
return {"status": "error", "message": "Expected 'ips' to be a list"}
self.parameters["local_allowlist"] = new_ips
return {"status": "success", "updated_allowlist": new_ips}
elif action == "fetch_remote_allowlist":
fetched = self.fetch_remote_allowlist()
self.allowlist_cache = fetched
return {"status": "success", "remote_allowlist": fetched}
elif action == "get_state":
return {
"status": "success",
"local_allowlist": self.parameters.get("local_allowlist", []),
"cached_remote_allowlist": self.allowlist_cache
}
else:
return {"status": "error", "message": f"Unknown action '{action}'"}
If you use third-party libraries, list them in code/requirements.txt:
2. Package it¶
Organize the files like this:
Then create a .zip (or .tar.xz) archive of the code directory:
3. Host the archive¶
Upload the archive anywhere with a public URL. One option is an assets registry:
curl -X POST http://<assets-registry-url>/upload_asset \
-H "Content-Type: multipart/form-data" \
-F "asset=@./ip-allow-list-checker.zip" \
-F 'asset_metadata={
"asset_name": "IP-allow-list",
"asset_version": { "version": "1.0", "tag": "beta" },
"asset_metadata": { "description": "IP allow list policy code" },
"asset_tags": ["policy", "example"]
}'
If it succeeds, the response contains the archive's public URL.
4. Register the policy¶
Describe the policy in a JSON document (data.json), with code set to the archive URL. The schema fields describe the expected inputs, outputs, settings, parameters and management commands; their template format is described in Template store. See PolicyRule for every field.
data.json
{
"name": "ip_allowlist",
"version": "1.0",
"release_tag": "beta",
"metadata": {
"author_name": "Jane Doe",
"author_email": "jane@example.com",
"organization": "Example Org",
"country": "US",
"license": "MIT",
"category": "network_access_control",
"use_case": "Control access to internal systems by validating request IPs against a dynamic and local allowlist.",
"geographic_scope": "Global",
"audience": ["network_admins", "security_teams"],
"integration_notes": "Ensure the allowlist API returns a JSON object with a top-level 'allowlist' key containing a list of IPs.",
"tested_environments": ["Ubuntu 22.04", "Amazon Linux 2"],
"execution_environment": "Python 3.10+",
"compliance_tags": ["ISO27001", "SOC2"]
},
"tags": "network,security,ip,access,allowlist",
"code": "https://example.com/code/ip_allowlist_policy.zip",
"type": "python_class_v1",
"policy_input_schema": {
"ip": {
"type": "string",
"description": "IP address of the incoming request",
"pattern": "^\\d{1,3}(\\.\\d{1,3}){3}$"
}
},
"policy_output_schema": {
"allowed": {
"type": "boolean",
"description": "Whether access is allowed"
},
"input_data": {
"type": "any",
"description": "Original input data"
},
"reason": {
"type": "string",
"description": "Reason for the decision"
}
},
"policy_settings_schema": {
"allowlist_api": {
"type": "string",
"description": "HTTP API endpoint that returns a JSON allowlist",
"pattern": "^https?://.*"
}
},
"policy_parameters_schema": {
"local_allowlist": {
"type": "array",
"description": "List of IPs locally allowed",
"max_length": 100,
"items": {
"type": "string",
"pattern": "^\\d{1,3}(\\.\\d{1,3}){3}$"
}
}
},
"policy_settings": {
"allowlist_api": "https://example.com/api/allowlist"
},
"policy_parameters": {
"local_allowlist": ["127.0.0.1", "192.168.0.1"]
},
"management_commands_schema": [
{
"name": "update_local_allowlist",
"description": "Replace the local allowlist with a new set of IPs",
"schema": {
"ips": {
"type": "array",
"items": {"type": "string", "pattern": "^\\d{1,3}(\\.\\d{1,3}){3}$"}
}
}
},
{
"name": "fetch_remote_allowlist",
"description": "Refresh the allowlist from the configured remote API",
"schema": {}
},
{
"name": "get_state",
"description": "Return current local and cached remote allowlist",
"schema": {}
}
],
"description": "Policy that checks whether a given IP is allowed based on a local list and a remote allowlist API."
}
Submit it to the Policies System:
curl -X POST http://<policy-system-url>/policy \
-H "Content-Type: application/json" \
-d @./data.json
The policy's policy rule URI is built from its name, version and release tag, {name}:{version}-{release_tag}:
This URI is what you reference everywhere else: block specs, pre-check policy updates, vDAG specs and so on.
5. Run the policy¶
Policies can be loaded and run from your own Python code with the local policy SDK, LocalPolicyEvaluator.
Where to find the SDK
The local policy SDK lives in services/management-services/policies-components/policies_local_sdk/ in the repository. AIOS services include it as a policy_sandbox module, imported with from policy_sandbox import LocalPolicyEvaluator. The examples below use the packaged name aios_policy_sandbox. Use whichever matches your installation.
from aios_policy_sandbox import LocalPolicyEvaluator
settings = {} # override the settings if needed
parameters = {} # override the parameters if needed
executor = LocalPolicyEvaluator(
policy_rule_uri="ip_allowlist:1.0-beta",
parameters=parameters,
settings=settings,
mode="local"
)
output = executor.execute_policy_rule({"ip": "192.168.0.109"})
print(output)
Send a management command to a loaded policy:
output = executor.execute_mgmt_command("update_local_allowlist", {
"ips": ["192.168.0.100", "192.168.0.102"]
})
print(output)
Policies System APIs¶
Policy rules¶
| Endpoint | Method | What it does |
|---|---|---|
/policy |
POST |
Register a policy (full PolicyRule JSON). |
/policy/<policy_rule_uri> |
GET |
Get a policy. |
/policy/<policy_rule_uri> |
PUT |
Update a policy (MongoDB-style update). |
/policy/<policy_rule_uri> |
DELETE |
Delete a policy. |
/policy/query |
POST |
Search policies with a MongoDB-style filter ($regex, $in, $gt, ...). |
# Register
curl -X POST http://<policy-system-url>/policy \
-H "Content-Type: application/json" \
-d @policy.json
# Get
curl http://<policy-system-url>/policy/ip_allowlist:1.0-beta
# Update
curl -X PUT http://<policy-system-url>/policy/ip_allowlist:1.0-beta \
-H "Content-Type: application/json" \
-d '{
"$set": {
"policy_parameters.local_allowlist": ["10.0.0.1", "8.8.8.8"],
"description": "Updated policy to allow new internal IP ranges."
}
}'
# Delete
curl -X DELETE http://<policy-system-url>/policy/ip_allowlist:1.0-beta
# Search
curl -X POST http://<policy-system-url>/policy/query \
-H "Content-Type: application/json" \
-d '{
"release_tag": "beta",
"tags": { "$regex": "security" },
"version": { "$gte": "1.0" }
}'
Executors (Type 2)¶
Anyone can deploy a policy executor and register it, so that applications and other users can run policies on it. To deploy one on your cluster, see Join a cluster: policy executor.
| Endpoint | Method | What it does |
|---|---|---|
/executor |
POST |
Register an executor (see the payload below). |
/executor/<executor_id> |
GET |
Get an executor. |
/executor/<executor_id> |
PUT |
Update an executor (MongoDB-style update). |
/executor/<executor_id> |
DELETE |
Delete an executor. |
/executor/query |
POST |
Search executors. |
/executor/<executor_id>/execute_policy |
POST |
Run a policy on the executor. |
/executor/<executor_id>/create-infra |
POST |
Deploy the executor onto a Kubernetes cluster (cluster_config is the cluster's kubeconfig as JSON). |
/executor/<executor_id>/remove-infra |
DELETE |
Remove the executor's infrastructure from the cluster. |
Executor registration payload (memory sizes in MB)
{
"executor_id": "executor-001",
"executor_metadata": {
"author_name": "Jane Doe",
"author_email": "jane@example.com",
"organization": "Example Org",
"country": "US",
"tags": ["amd_64", "kubernetes-cluster", "NIC"],
"description": "My executor deployed on kubernetes"
},
"executor_hardware_info": {
"nodes": {
"count": 2,
"nodeData": [
{
"id": "node-001",
"vcpus": {
"count": 12
},
"memory": 32005,
"swap": 975,
"storage": {
"disks": 53,
"size": 488742
},
"network": {
"interfaces": 10,
"txBandwidth": 0,
"rxBandwidth": 0
}
},
{
"id": "node-002",
"vcpus": {
"count": 12
},
"memory": 32005,
"swap": 975,
"storage": {
"disks": 53,
"size": 488742
},
"network": {
"interfaces": 10,
"txBandwidth": 0,
"rxBandwidth": 0
}
}
]
},
"vcpus": {
"count": 24
},
"memory": 64010,
"swap": 1950,
"storage": {
"disks": 106,
"size": 977484
},
"network": {
"interfaces": 20,
"txBandwidth": 0,
"rxBandwidth": 0
},
"id": "cluster-123"
}
}
# Register
curl -X POST http://<policy-system-url>/executor \
-H "Content-Type: application/json" \
-d @executor.json
# Get
curl http://<policy-system-url>/executor/executor-001
# Update
curl -X PUT http://<policy-system-url>/executor/executor-001 \
-H "Content-Type: application/json" \
-d '{
"$set": {
"executor_metadata.tags": ["amd_64", "zero-downtime", "ai-worker"],
"executor_metadata.description": "Executor for AI worker policies"
}
}'
# Delete
curl -X DELETE http://<policy-system-url>/executor/executor-001
# Search: executors tagged kubernetes-cluster with at least 16 vCPUs
curl -X POST http://<policy-system-url>/executor/query \
-H "Content-Type: application/json" \
-d '{
"executor_metadata.tags": { "$in": ["kubernetes-cluster"] },
"executor_hardware_info.vcpus.count": { "$gte": 16 }
}'
# Run a policy on the executor
curl -X POST http://<policy-system-url>/executor/executor-001/execute_policy \
-H "Content-Type: application/json" \
-d '{
"policy_rule_uri": "ip_allowlist:1.0-beta",
"input_data": {
"ip": "10.0.0.1"
},
"parameters": {
"local_allowlist": ["10.0.0.1"]
}
}'
# Deploy the executor onto a cluster
curl -X POST http://<policy-system-url>/executor/executor-001/create-infra \
-H "Content-Type: application/json" \
-d '{
"cluster_config": <json-data of the kubeconfig file>
}'
# Remove it
curl -X DELETE http://<policy-system-url>/executor/executor-001/remove-infra \
-H "Content-Type: application/json" \
-d '{
"cluster_config": {
"provider": "kubernetes",
"region": "us-west"
}
}'
Jobs (Type 3)¶
| Endpoint | Method | What it does |
|---|---|---|
/jobs/submit/<executor_id> |
POST |
Run a policy once as a job on an executor. If executor_id is empty, a resource allocation policy chooses one. |
/jobs/<job_id> |
GET |
Get a job's status and result. |
/jobs/query |
POST |
Search jobs, by executor, policy, status and so on. |
# Submit
curl -X POST http://<policy-system-url>/jobs/submit/executor-001 \
-H "Content-Type: application/json" \
-d '{
"name": "run-ip-check-job",
"policy_rule_uri": "ip_allowlist:1.0-beta",
"policy_rule_parameters": {
"local_allowlist": ["192.168.1.1"]
},
"node_selector": {
"zone": "us-central1-a"
},
"inputs": {
"ip": "192.168.1.1"
}
}'
# Get
curl http://<policy-system-url>/jobs/1a2b3c4d-5678-9012-efgh-1234567890ab
# Search
curl -X POST http://<policy-system-url>/jobs/query \
-H "Content-Type: application/json" \
-d '{
"policy_rule_uri": "ip_allowlist:1.0-beta",
"inputs.ip": "192.168.1.1"
}'
Functions (Type 4)¶
| Endpoint | Method | What it does |
|---|---|---|
/function/deployments/create/<executor_id> |
POST |
Deploy a policy as a function on an executor. If executor_id is "", a policy chooses the executor. |
/function/deployments/remove/<name> |
DELETE |
Remove a function and its registry entry. |
/function/call_function/<name> |
POST |
Call a function with input data. |
/function/<function_id> |
GET |
Get a function's details. |
/function/query |
POST |
Search functions, by tags, policy, executor and so on. |
# Deploy
curl -X POST http://<policy-system-url>/function/deployments/create/executor-001 \
-H "Content-Type: application/json" \
-d '{
"name": "check-ip-fn",
"policy_rule_uri": "ip_allowlist:1.0-beta",
"policy_rule_parameters": {
"local_allowlist": ["10.0.0.1"]
},
"replicas": 2,
"autoscaling": {
"enabled": true,
"min_replicas": 1,
"max_replicas": 5,
"target_cpu_utilization_percentage": 10
},
"function_metadata": {
"maintainer": "network-team",
"description": "Checks IP allowlist"
},
"function_tags": ["network", "security"]
}'
# Call
curl -X POST http://<policy-system-url>/function/call_function/check-ip-fn \
-H "Content-Type: application/json" \
-d '{
"ip": "10.0.0.1"
}'
# Get
curl http://<policy-system-url>/function/check-ip-fn
# Search
curl -X POST http://<policy-system-url>/function/query \
-H "Content-Type: application/json" \
-d '{
"function_tags": { "$in": ["network"] },
"function_policy_rule_uri": "ip_allowlist:1.0-beta"
}'
# Remove
curl -X DELETE http://<policy-system-url>/function/deployments/remove/check-ip-fn
Graphs (Type 5)¶
A policy graph connects Type 4 functions into a DAG. For example:
is written as a map from each function to the functions that receive its output:
Graph registration payload (graph.json)
{
"graph_name": "ip_risk_analysis",
"graph_version": "1.0",
"graph_release_tag": "stable",
"graph_metadata": {
"author_name": "Jane Doe",
"author_email": "jane@example.com",
"organization": "Example Org",
"country": "US",
"license": "MIT",
"use_case": "End-to-end evaluation of IP risk using threat intel and activity logs.",
"category": "security_pipeline",
"tags": ["ip", "risk", "pipeline", "security", "graph"]
},
"graph_function_ids": ["funcA", "funcB", "funcC", "funcD"],
"graph_connection_data": {
"funcA": ["funcB", "funcC"],
"funcB": ["funcD"],
"funcC": ["funcD"]
},
"graph_search_tags": ["ip", "pipeline", "threat", "analysis"],
"graph_description": "A multi-function policy graph that evaluates the risk level of an incoming IP using allowlist check, threat intelligence, and activity logs before making a final decision.",
"graph_input_schema": {
"ip": {
"type": "string",
"description": "IP address to be analyzed",
"pattern": "^\\d{1,3}(\\.\\d{1,3}){3}$"
}
},
"graph_output_schema": {
"decision": {
"type": "string",
"description": "Final access decision",
"choices": ["allow", "block", "review"]
},
"reason": {
"type": "string",
"description": "Explanation of decision"
}
}
}
| Endpoint | Method | What it does |
|---|---|---|
/graphs |
POST |
Register a graph. |
/graphs/<graph_uri> |
GET |
Get a graph. |
/graphs/<graph_uri> |
PUT |
Update a graph (MongoDB-style update). |
/graphs/<graph_uri> |
DELETE |
Delete a graph. |
/graphs/query |
POST |
Search graphs. |
/graph/execute_graph |
POST |
Run a graph end to end. The input must match the first function's input schema. |
# Register
curl -X POST http://<policy-system-url>/graphs \
-H "Content-Type: application/json" \
-d @graph.json
# Get
curl http://<policy-system-url>/graphs/ip_risk_analysis:1.0-stable
# Update
curl -X PUT http://<policy-system-url>/graphs/ip_risk_analysis:1.0-stable \
-H "Content-Type: application/json" \
-d '{
"$set": {
"graph_version": "2.0",
"graph_search_tags": ["ip", "network-analysis", "ip-access-check"]
}
}'
# Delete
curl -X DELETE http://<policy-system-url>/graphs/ip_risk_analysis:1.0-stable
# Search
curl -X POST http://<policy-system-url>/graphs/query \
-H "Content-Type: application/json" \
-d '{
"graph_search_tags": { "$in": ["security"] },
"graph_version": "1.0"
}'
# Run
curl -X POST http://<policy-system-url>/graph/execute_graph \
-H "Content-Type: application/json" \
-d '{
"graph_uri": "ip_risk_analysis:1.0-stable",
"input_data": {
"ip": "192.168.1.1"
}
}'
Data reference¶
PolicyRule¶
A registered policy.
@dataclass
class PolicyRule:
policy_rule_uri: str
name: str
version: str
release_tag: str
metadata: Dict
tags: str
code: str
type: str
policy_input_schema: Dict
policy_output_schema: Dict
policy_settings_schema: Dict
policy_parameters_schema: Dict
policy_settings: Dict
policy_parameters: Dict
management_commands_schema: list
description: str
| Field | Description |
|---|---|
policy_rule_uri |
Unique ID, built as {name}:{version}-{release_tag}, for example access_control:1.0-beta. |
name |
The policy's name. |
version |
Version, for example 1.0. |
release_tag |
Release stage, for example beta or stable. |
metadata |
Free-form details: author, dates, change notes and so on. |
tags |
Comma-separated tags, for search. |
code |
URL of the policy's code archive. |
type |
Policy code format, for example python_class_v1. |
policy_input_schema |
Expected input structure. |
policy_output_schema |
Expected output structure. |
policy_settings_schema |
Allowed settings. |
policy_parameters_schema |
Allowed parameters. |
policy_settings |
Default settings. |
policy_parameters |
Default parameters. |
management_commands_schema |
List of supported management commands and their inputs. |
description |
Human-readable description. |
PolicyExecutors¶
A policy executor that someone has deployed and registered.
@dataclass
class PolicyExecutors:
executor_id: str
executor_host_uri: str
executor_metadata: Dict
executor_hardware_info: Dict
executor_status: str = field(default="healthy")
| Field | Description |
|---|---|
executor_id |
Unique ID. |
executor_host_uri |
Where the executor is reachable (IP and port, or DNS name). |
executor_metadata |
Free-form details: tags, description, version, deployment notes. |
executor_hardware_info |
Hardware of the machine or cluster it runs on. |
executor_status |
Current status, for example healthy, unreachable or busy. Default: healthy. |
Function¶
A deployed Type 4 policy.
@dataclass
class Function:
function_id: str
function_executor_id: str
function_executor_uri: str
function_metadata: Dict
function_tags: List[str]
function_policy_rule_uri: str
function_policy_data: Dict
| Field | Description |
|---|---|
function_id |
Unique ID, used to call and manage it. |
function_executor_id |
The executor running it (a PolicyExecutors.executor_id). |
function_executor_uri |
Where it is reachable. |
function_metadata |
Free-form details: deployment time, version, owner, configuration. |
function_tags |
Tags, for search. |
function_policy_rule_uri |
The policy it runs (a PolicyRule.policy_rule_uri). |
function_policy_data |
A snapshot of the policy's data: schemas, settings, parameters. |
Graph¶
A Type 5 policy graph.
@dataclass
class Graph:
graph_uri: str
graph_name: str
graph_version: str
graph_release_tag: str
graph_metadata: str
graph_function_ids: List[str]
graph_connection_data: Dict
graph_search_tags: List[str]
graph_description: str
graph_input_schema: Dict
graph_output_schema: Dict
| Field | Description |
|---|---|
graph_uri |
Unique ID, built as {graph_name}:{graph_version}-{graph_release_tag}. |
graph_name |
Name, for example fraud-detection-graph. |
graph_version |
Version. |
graph_release_tag |
Release stage, for example beta or prod. |
graph_metadata |
Free-form details: author, dates, notes. |
graph_function_ids |
The functions that form the graph's nodes. |
graph_connection_data |
The edges: each function mapped to the functions that receive its output. |
graph_search_tags |
Tags, for search. |
graph_description |
Human-readable description. |
graph_input_schema |
Expected input structure. |
graph_output_schema |
Expected output structure. |