Permission Policies
All six SDKs expose path permissions (PermissionsManager), data-plane access
and redaction policies (DataPlanePolicy), network domain allowlist checks
(NetworkPolicy / SecurityClient.checkDomain / check_network_domain), and
credential tokenization (SecretMasker). These controls apply wherever they are
attached to the agent, sandbox, or tool resolution path; they do not
automatically mediate arbitrary network or filesystem calls inside custom
application code.
- Python
- TypeScript
- Rust
- Go
- C#
- Java
from ish import Agent, DataPlanePolicy, RegisterAccessRule
policy = DataPlanePolicy(
rules=[
RegisterAccessRule(
agent_pattern="public_*",
source_tool_pattern="*",
target_tool_pattern="private_*",
mode="deny",
)
],
default_mode="allow",
mask_secrets=True,
)
agent = Agent(
name="reviewer",
model="gpt-4o-mini",
data_plane_policy=policy,
)
import { Agent, DataPlanePolicy, IshClient } from "ish-harness";
const client = new IshClient();
const policy = new DataPlanePolicy(client, {
rules: [
{
agent_pattern: "public_*",
source_tool_pattern: "*",
target_tool_pattern: "private_*",
mode: "deny",
},
],
defaultMode: "allow",
maskSecrets: true,
});
const agent = new Agent({
name: "reviewer",
model: { provider: "openai_chat", name: "gpt-4o-mini" },
data_policy_handle: policy.handle,
});
use ish_harness::{DataPlanePolicy, RegisterAccessRule};
let policy = DataPlanePolicy::with_sanitization(
vec![RegisterAccessRule {
agent_pattern: "public_*".to_string(),
source_tool_pattern: "*".to_string(),
target_tool_pattern: Some("private_*".to_string()),
mode: "deny".to_string(),
}],
"allow",
true, // mask_secrets
false, // mask_pii
vec![],
);
policy, err := ish.NewDataPlanePolicy(
client,
[]ish.RegisterAccessRule{
{
AgentPattern: "public_*",
SourceToolPattern: "*",
TargetToolPattern: "private_*",
Mode: "deny",
},
},
"allow",
true, // maskSecrets
false, // maskPII
nil,
nil,
)
if err != nil {
panic(err)
}
defer policy.Close()
allowed, err := policy.Check("public_worker", "read_logs", "private_sink", "")
fmt.Println("Allowed:", allowed)
using Ish.Harness;
using var client = new IshClient();
using var policy = new DataPlanePolicy(
client,
rules:
[
new RegisterAccessRule(
AgentPattern: "public_*",
SourceToolPattern: "*",
TargetToolPattern: "private_*",
Mode: "deny"),
],
defaultMode: "allow",
maskSecrets: true);
bool allowed = policy.Check("public_worker", "read_logs", "private_sink");
Console.WriteLine($"Allowed: {allowed}");
import io.github.ishharness.DataPlanePolicy;
import java.util.List;
try (var policy = new DataPlanePolicy(
client,
List.of(new DataPlanePolicy.Rule("public_*", "*", "private_*", "deny")),
"allow",
true,
false,
List.of(),
null)) {
boolean allowed = policy.check("public_worker", "read_logs", "private_sink");
System.out.println("Allowed: " + allowed);
}
Data-plane policy (DataPlanePolicy)
DataPlanePolicy restricts $DATA: / $SOURCE_DATA: cross-tool transfers and
can mask secrets or PII in handled payloads:
Review rule precedence and defaults for your use case. A policy that defaults
to allow needs explicit deny rules for restricted paths.
Network checks, secret masking
Use NetworkPolicy (Python), check_network_domain (Rust), or SecurityClient
(TypeScript, Go, C#, Java) to evaluate outbound host allowlists, and
SecretMasker to issue capability-bound [SECRET:...] references:
- Python
- TypeScript
- Rust
- Go
- C#
- Java
from ish import NetworkPolicy, SecretMasker
network_policy = NetworkPolicy(allowed_domains=["api.example.com"], default_action="deny")
print(network_policy.is_allowed("https://api.example.com/v1/status"))
masker = SecretMasker()
token = masker.register("example-secret", provenance="application")
masked_text = masker.mask("credential: example-secret")
import { IshClient, SecretMasker, SecurityClient } from "ish-harness";
const client = new IshClient();
const security = new SecurityClient(client);
console.log(security.checkDomain("https://api.example.com/v1/status", ["api.example.com"], false));
const masker = new SecretMasker(client);
const token = masker.register("example-secret", "application");
const maskedText = masker.mask("credential: example-secret", "application");
console.log(token, maskedText);
use ish_harness::{check_network_domain, SecretMasker};
let allowed = check_network_domain(
"https://api.example.com/v1/status",
&["api.example.com".to_string()],
false,
);
let masker = SecretMasker::default();
let token = masker.register_with_provenance("example-secret", "application");
let (masked_text, _) = masker.mask_text_with_provenance("credential: example-secret", "application");
println!("{allowed} {token} {masked_text}");
security := ish.NewSecurityClient(client)
allowed, err := security.CheckDomain("https://api.example.com/v1/status", []string{"api.example.com"}, false)
masker, err := ish.NewSecretMasker(client, nil, "", "", 0)
defer masker.Close()
token, err := masker.Register("example-secret", "application")
maskedText, err := masker.Mask("credential: example-secret", "application")
fmt.Println(allowed, token, maskedText)
using Ish.Harness;
using var client = new IshClient();
var security = new SecurityClient(client);
bool allowed = security.CheckDomain("https://api.example.com/v1/status", ["api.example.com"], defaultAllow: false);
using var masker = new SecretMasker(client);
string token = masker.Register("example-secret", provenance: "application");
string maskedText = masker.Mask("credential: example-secret", provenance: "application");
Console.WriteLine($"{allowed} {token} {maskedText}");
import io.github.ishharness.SecretMasker;
import io.github.ishharness.SecurityClient;
import java.util.List;
var security = new SecurityClient(client);
boolean allowed = security.checkDomain(
"https://api.example.com/v1/status",
List.of("api.example.com"),
false);
try (var masker = new SecretMasker(client)) {
String token = masker.register("example-secret", "application");
String maskedText = masker.mask("credential: example-secret", "application");
System.out.println(allowed + " " + token + " " + maskedText);
}
See Deterministic guardrails for PermissionsManager
filesystem rules across all six SDKs and each SDK README for error types and
secret restoration parameters.