Python
import os
from meibel import MeibelClient
from meibel.models import (
UpdateExecutionPolicyRequest,
ExecutionPolicy,
DatasourceView,
TagConstraints,
ToolConfig,
)
client = MeibelClient(api_key=os.environ["MEIBEL_API_KEY"])
updated_policy = ExecutionPolicy(
datasources={
"ds_customer_orders": DatasourceView(
tables=TagConstraints(
filter={"region": {"$in": ["us-east", "us-west"]}},
hidden_columns={"customers": ["email", "phone"]},
),
),
},
tools={
"send_email": ToolConfig(disabled=True),
},
)
request = UpdateExecutionPolicyRequest(
name="Regional Support Policy - Restricted",
description="Limits agents to US regions and disables outbound email",
execution_policy=updated_policy,
)
response = client.execution_policies.update("policy_8f3a1c2d", request)
print(f"Updated policy: {response.name} (updated_at={response.updated_at})")import { MeibelClient } from "meibel";
const client = new MeibelClient({ apiKey: process.env.MEIBEL_API_KEY });
const updatedPolicy = await client.executionPolicies.update({
policy_id: "policy_9f2c1a4b",
name: "Support Agent - Restricted Access",
description: "Limits support agents to customer support datasource and read-only tools",
execution_policy: {
datasources: {
ds_customer_support: {
disabled: false,
tables: {
filter: { region: { $eq: "us-east" } },
hidden_columns: { customers: ["ssn", "credit_card_number"] },
},
documents: {
filter: { document_type: { $in: ["faq", "policy"] } },
},
},
},
tools: {
refund_processor: {
disabled: true,
},
order_lookup: {
variables: { max_results: { $lte: 25 } },
},
},
},
});
console.log(`Updated policy ${updatedPolicy.id} at ${updatedPolicy.updated_at}`);package main
import (
"context"
"fmt"
"os"
v2 "github.com/meibel-ai/meibel-go/v2"
)
func main() {
client := v2.NewClient(v2.WithAPIKey(os.Getenv("MEIBEL_API_KEY")))
policy, err := client.ExecutionPolicies.Update(
context.Background(),
"policy_9f2c7a1b",
v2.UpdateExecutionPolicyRequest{
Name: v2.String("Support Agent Policy - Restricted"),
Description: v2.String("Restricts support agent to redacted customer data and read-only tools"),
ExecutionPolicy: &v2.ExecutionPolicy{
Datasources: map[string]v2.DatasourceView{
"ds_customer_db": {
Tables: &v2.TagConstraints{
HiddenColumns: map[string][]string{
"customers": {"ssn", "credit_card_number"},
},
},
},
},
Tools: map[string]v2.ToolConfig{
"refund_issuer": {
Disabled: v2.Bool(true),
},
},
},
},
)
if err != nil {
fmt.Printf("failed to update execution policy: %v\n", err)
return
}
fmt.Printf("Updated policy %s (%s), last updated at %s\n", policy.ID, policy.Name, policy.UpdatedAt)
}curl --request PUT \
--url https://api.meibel.ai/v2/execution-policies/{policy_id} \
--header 'Content-Type: application/json' \
--header 'Meibel-API-Key: <api-key>' \
--data '
{
"name": "eu-restricted-read-only-v2",
"description": "Updated EU restriction with additional tool block",
"execution_policy": {
"datasources": {
"ds_abc123": {
"tables": {
"filter": {
"table.__name__": {
"$in": [
"orders",
"customers"
]
},
"orders.region": {
"$eq": "EU"
}
},
"hidden_columns": {
"customers": [
"ssn",
"credit_card"
]
}
},
"documents": {
"filter": {
"data_element.__id__": {
"$in": [
"de_abc",
"de_def"
]
}
}
}
},
"ds_xyz789": {
"disabled": true
}
},
"tools": {
"send_email": {
"variables": {
"to": {
"$eq": "support@acme.com"
},
"max_attachments": {
"$lte": 3
}
}
},
"web_search": {
"disabled": true
}
}
}
}
'const options = {
method: 'PUT',
headers: {'Meibel-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'eu-restricted-read-only-v2',
description: 'Updated EU restriction with additional tool block',
execution_policy: {
datasources: {
ds_abc123: {
tables: {
filter: {'table.__name__': {$in: ['orders', 'customers']}, 'orders.region': {$eq: 'EU'}},
hidden_columns: {customers: ['ssn', 'credit_card']}
},
documents: {filter: {'data_element.__id__': {$in: ['de_abc', 'de_def']}}}
},
ds_xyz789: {disabled: true}
},
tools: {
send_email: {variables: {to: {$eq: 'support@acme.com'}, max_attachments: {$lte: 3}}},
web_search: {disabled: true}
}
}
})
};
fetch('https://api.meibel.ai/v2/execution-policies/{policy_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.meibel.ai/v2/execution-policies/{policy_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'eu-restricted-read-only-v2',
'description' => 'Updated EU restriction with additional tool block',
'execution_policy' => [
'datasources' => [
'ds_abc123' => [
'tables' => [
'filter' => [
'table.__name__' => [
'$in' => [
'orders',
'customers'
]
],
'orders.region' => [
'$eq' => 'EU'
]
],
'hidden_columns' => [
'customers' => [
'ssn',
'credit_card'
]
]
],
'documents' => [
'filter' => [
'data_element.__id__' => [
'$in' => [
'de_abc',
'de_def'
]
]
]
]
],
'ds_xyz789' => [
'disabled' => true
]
],
'tools' => [
'send_email' => [
'variables' => [
'to' => [
'$eq' => 'support@acme.com'
],
'max_attachments' => [
'$lte' => 3
]
]
],
'web_search' => [
'disabled' => true
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"Meibel-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.put("https://api.meibel.ai/v2/execution-policies/{policy_id}")
.header("Meibel-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"eu-restricted-read-only-v2\",\n \"description\": \"Updated EU restriction with additional tool block\",\n \"execution_policy\": {\n \"datasources\": {\n \"ds_abc123\": {\n \"tables\": {\n \"filter\": {\n \"table.__name__\": {\n \"$in\": [\n \"orders\",\n \"customers\"\n ]\n },\n \"orders.region\": {\n \"$eq\": \"EU\"\n }\n },\n \"hidden_columns\": {\n \"customers\": [\n \"ssn\",\n \"credit_card\"\n ]\n }\n },\n \"documents\": {\n \"filter\": {\n \"data_element.__id__\": {\n \"$in\": [\n \"de_abc\",\n \"de_def\"\n ]\n }\n }\n }\n },\n \"ds_xyz789\": {\n \"disabled\": true\n }\n },\n \"tools\": {\n \"send_email\": {\n \"variables\": {\n \"to\": {\n \"$eq\": \"support@acme.com\"\n },\n \"max_attachments\": {\n \"$lte\": 3\n }\n }\n },\n \"web_search\": {\n \"disabled\": true\n }\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.meibel.ai/v2/execution-policies/{policy_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Meibel-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"eu-restricted-read-only-v2\",\n \"description\": \"Updated EU restriction with additional tool block\",\n \"execution_policy\": {\n \"datasources\": {\n \"ds_abc123\": {\n \"tables\": {\n \"filter\": {\n \"table.__name__\": {\n \"$in\": [\n \"orders\",\n \"customers\"\n ]\n },\n \"orders.region\": {\n \"$eq\": \"EU\"\n }\n },\n \"hidden_columns\": {\n \"customers\": [\n \"ssn\",\n \"credit_card\"\n ]\n }\n },\n \"documents\": {\n \"filter\": {\n \"data_element.__id__\": {\n \"$in\": [\n \"de_abc\",\n \"de_def\"\n ]\n }\n }\n }\n },\n \"ds_xyz789\": {\n \"disabled\": true\n }\n },\n \"tools\": {\n \"send_email\": {\n \"variables\": {\n \"to\": {\n \"$eq\": \"support@acme.com\"\n },\n \"max_attachments\": {\n \"$lte\": 3\n }\n }\n },\n \"web_search\": {\n \"disabled\": true\n }\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"customer_id": "<string>",
"project_id": "<string>",
"name": "<string>",
"execution_policy": {
"datasources": {},
"tools": {}
},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"description": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Execution policies
Update Execution Policy
PUT
/
execution-policies
/
{policy_id}
Python
import os
from meibel import MeibelClient
from meibel.models import (
UpdateExecutionPolicyRequest,
ExecutionPolicy,
DatasourceView,
TagConstraints,
ToolConfig,
)
client = MeibelClient(api_key=os.environ["MEIBEL_API_KEY"])
updated_policy = ExecutionPolicy(
datasources={
"ds_customer_orders": DatasourceView(
tables=TagConstraints(
filter={"region": {"$in": ["us-east", "us-west"]}},
hidden_columns={"customers": ["email", "phone"]},
),
),
},
tools={
"send_email": ToolConfig(disabled=True),
},
)
request = UpdateExecutionPolicyRequest(
name="Regional Support Policy - Restricted",
description="Limits agents to US regions and disables outbound email",
execution_policy=updated_policy,
)
response = client.execution_policies.update("policy_8f3a1c2d", request)
print(f"Updated policy: {response.name} (updated_at={response.updated_at})")import { MeibelClient } from "meibel";
const client = new MeibelClient({ apiKey: process.env.MEIBEL_API_KEY });
const updatedPolicy = await client.executionPolicies.update({
policy_id: "policy_9f2c1a4b",
name: "Support Agent - Restricted Access",
description: "Limits support agents to customer support datasource and read-only tools",
execution_policy: {
datasources: {
ds_customer_support: {
disabled: false,
tables: {
filter: { region: { $eq: "us-east" } },
hidden_columns: { customers: ["ssn", "credit_card_number"] },
},
documents: {
filter: { document_type: { $in: ["faq", "policy"] } },
},
},
},
tools: {
refund_processor: {
disabled: true,
},
order_lookup: {
variables: { max_results: { $lte: 25 } },
},
},
},
});
console.log(`Updated policy ${updatedPolicy.id} at ${updatedPolicy.updated_at}`);package main
import (
"context"
"fmt"
"os"
v2 "github.com/meibel-ai/meibel-go/v2"
)
func main() {
client := v2.NewClient(v2.WithAPIKey(os.Getenv("MEIBEL_API_KEY")))
policy, err := client.ExecutionPolicies.Update(
context.Background(),
"policy_9f2c7a1b",
v2.UpdateExecutionPolicyRequest{
Name: v2.String("Support Agent Policy - Restricted"),
Description: v2.String("Restricts support agent to redacted customer data and read-only tools"),
ExecutionPolicy: &v2.ExecutionPolicy{
Datasources: map[string]v2.DatasourceView{
"ds_customer_db": {
Tables: &v2.TagConstraints{
HiddenColumns: map[string][]string{
"customers": {"ssn", "credit_card_number"},
},
},
},
},
Tools: map[string]v2.ToolConfig{
"refund_issuer": {
Disabled: v2.Bool(true),
},
},
},
},
)
if err != nil {
fmt.Printf("failed to update execution policy: %v\n", err)
return
}
fmt.Printf("Updated policy %s (%s), last updated at %s\n", policy.ID, policy.Name, policy.UpdatedAt)
}curl --request PUT \
--url https://api.meibel.ai/v2/execution-policies/{policy_id} \
--header 'Content-Type: application/json' \
--header 'Meibel-API-Key: <api-key>' \
--data '
{
"name": "eu-restricted-read-only-v2",
"description": "Updated EU restriction with additional tool block",
"execution_policy": {
"datasources": {
"ds_abc123": {
"tables": {
"filter": {
"table.__name__": {
"$in": [
"orders",
"customers"
]
},
"orders.region": {
"$eq": "EU"
}
},
"hidden_columns": {
"customers": [
"ssn",
"credit_card"
]
}
},
"documents": {
"filter": {
"data_element.__id__": {
"$in": [
"de_abc",
"de_def"
]
}
}
}
},
"ds_xyz789": {
"disabled": true
}
},
"tools": {
"send_email": {
"variables": {
"to": {
"$eq": "support@acme.com"
},
"max_attachments": {
"$lte": 3
}
}
},
"web_search": {
"disabled": true
}
}
}
}
'const options = {
method: 'PUT',
headers: {'Meibel-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'eu-restricted-read-only-v2',
description: 'Updated EU restriction with additional tool block',
execution_policy: {
datasources: {
ds_abc123: {
tables: {
filter: {'table.__name__': {$in: ['orders', 'customers']}, 'orders.region': {$eq: 'EU'}},
hidden_columns: {customers: ['ssn', 'credit_card']}
},
documents: {filter: {'data_element.__id__': {$in: ['de_abc', 'de_def']}}}
},
ds_xyz789: {disabled: true}
},
tools: {
send_email: {variables: {to: {$eq: 'support@acme.com'}, max_attachments: {$lte: 3}}},
web_search: {disabled: true}
}
}
})
};
fetch('https://api.meibel.ai/v2/execution-policies/{policy_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.meibel.ai/v2/execution-policies/{policy_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'eu-restricted-read-only-v2',
'description' => 'Updated EU restriction with additional tool block',
'execution_policy' => [
'datasources' => [
'ds_abc123' => [
'tables' => [
'filter' => [
'table.__name__' => [
'$in' => [
'orders',
'customers'
]
],
'orders.region' => [
'$eq' => 'EU'
]
],
'hidden_columns' => [
'customers' => [
'ssn',
'credit_card'
]
]
],
'documents' => [
'filter' => [
'data_element.__id__' => [
'$in' => [
'de_abc',
'de_def'
]
]
]
]
],
'ds_xyz789' => [
'disabled' => true
]
],
'tools' => [
'send_email' => [
'variables' => [
'to' => [
'$eq' => 'support@acme.com'
],
'max_attachments' => [
'$lte' => 3
]
]
],
'web_search' => [
'disabled' => true
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"Meibel-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.put("https://api.meibel.ai/v2/execution-policies/{policy_id}")
.header("Meibel-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"eu-restricted-read-only-v2\",\n \"description\": \"Updated EU restriction with additional tool block\",\n \"execution_policy\": {\n \"datasources\": {\n \"ds_abc123\": {\n \"tables\": {\n \"filter\": {\n \"table.__name__\": {\n \"$in\": [\n \"orders\",\n \"customers\"\n ]\n },\n \"orders.region\": {\n \"$eq\": \"EU\"\n }\n },\n \"hidden_columns\": {\n \"customers\": [\n \"ssn\",\n \"credit_card\"\n ]\n }\n },\n \"documents\": {\n \"filter\": {\n \"data_element.__id__\": {\n \"$in\": [\n \"de_abc\",\n \"de_def\"\n ]\n }\n }\n }\n },\n \"ds_xyz789\": {\n \"disabled\": true\n }\n },\n \"tools\": {\n \"send_email\": {\n \"variables\": {\n \"to\": {\n \"$eq\": \"support@acme.com\"\n },\n \"max_attachments\": {\n \"$lte\": 3\n }\n }\n },\n \"web_search\": {\n \"disabled\": true\n }\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.meibel.ai/v2/execution-policies/{policy_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Meibel-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"eu-restricted-read-only-v2\",\n \"description\": \"Updated EU restriction with additional tool block\",\n \"execution_policy\": {\n \"datasources\": {\n \"ds_abc123\": {\n \"tables\": {\n \"filter\": {\n \"table.__name__\": {\n \"$in\": [\n \"orders\",\n \"customers\"\n ]\n },\n \"orders.region\": {\n \"$eq\": \"EU\"\n }\n },\n \"hidden_columns\": {\n \"customers\": [\n \"ssn\",\n \"credit_card\"\n ]\n }\n },\n \"documents\": {\n \"filter\": {\n \"data_element.__id__\": {\n \"$in\": [\n \"de_abc\",\n \"de_def\"\n ]\n }\n }\n }\n },\n \"ds_xyz789\": {\n \"disabled\": true\n }\n },\n \"tools\": {\n \"send_email\": {\n \"variables\": {\n \"to\": {\n \"$eq\": \"support@acme.com\"\n },\n \"max_attachments\": {\n \"$lte\": 3\n }\n }\n },\n \"web_search\": {\n \"disabled\": true\n }\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"customer_id": "<string>",
"project_id": "<string>",
"name": "<string>",
"execution_policy": {
"datasources": {},
"tools": {}
},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"description": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
Path Parameters
Body
application/json
Response
Successful Response
ExecutionPolicyResponse
Session-level access constraints (hardrails) for data and tools. Controls what data an agent session can access and what tools it can use. Constraints are enforced by the platform at runtime — the agent cannot bypass them. Multiple policies can be composed: stored policies (by ID) and/or an inline policy are structurally merged. Overlapping datasource or tool entries are combined with $and (intersection semantics). All filter fields use MongoDB-style constraint operators. Plain values are automatically normalized to {"$eq": value}.
Show child attributes
Show child attributes
Was this page helpful?
⌘I