PromptSpeak Governance

v0.4.1
io.github.chrbailey/promptspeak Checked 13 hours ago Published 8 months ago

Pre-execution governance for AI agents.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

ps_validate

Validate a PromptSpeak frame. Returns validation report with errors, warnings, and suggestions.

ParameterTypeDescription
frame *stringThe PromptSpeak frame to validate (e.g., "⊕◊▶β")
parentFramestringOptional parent frame for chain validation
strictbooleanIf true, warnings also cause validation failure
validationLevelstringLevel of validation to perform

ps_validate_batch

Validate multiple frames at once. Useful for validating delegation chains.

ParameterTypeDescription
frames *array
stopOnFirstErrorboolean
strictboolean
validationLevelstring

ps_execute

Execute an action under PromptSpeak frame governance. The gatekeeper validates and enforces constraints.

ParameterTypeDescription
action *object
agentId *stringUnique identifier for the executing agent
frame *stringThe governing PromptSpeak frame
parentFramestringParent frame if part of delegation chain

ps_execute_dry_run

Check if an action would succeed without executing. Returns decision and coverage analysis.

ParameterTypeDescription
action *object
agentId *string
frame *string
parentFramestring

ps_execute_batch

Execute multiple actions under a single frame. Supports sequential or parallel execution with optional stop-on-failure.

ParameterTypeDescription
actions *arrayArray of actions to execute under the frame
agentId *stringUnique identifier for the executing agent
frame *stringThe governing PromptSpeak frame for all actions
parallelbooleanExecute all actions in parallel instead of sequentially
parentFramestringParent frame if part of delegation chain
stopOnFirstFailurebooleanStop executing remaining actions on first failure (sequential only)

ps_delegate

Delegate a task from parent agent to child agent. Enforces inheritance rules and constraint propagation.

ParameterTypeDescription
childAgentId *string
childFrame *string
parentAgentId *string
parentFrame *string
inheritanceModestring
taskobject

ps_delegate_revoke

Revoke an active delegation.

ParameterTypeDescription
delegationId *string
parentAgentId *string
reasonstring

ps_delegate_list

List delegations for an agent.

ParameterTypeDescription
agentId *string
rolestring
statusstring

ps_state_get

Get current state of an agent including drift metrics and circuit breaker status.

ParameterTypeDescription
agentId *string

ps_state_system

Get overall system state including all agents, operations, and drift alerts.

ps_state_reset

Reset agent state. Can reset circuit breaker, drift metrics, and/or baseline.

ParameterTypeDescription
agentId *string
reason *string
resetBaselineboolean
resetCircuitBreakerboolean
resetDriftMetricsboolean

ps_state_recalibrate

Recalibrate agent drift baseline. Optionally provide a new baseline configuration.

ParameterTypeDescription
agentId *stringAgent to recalibrate
newBaselineobjectOptional new baseline configuration. If omitted, recalibrates from current state.

ps_state_halt

Immediately halt an agent by opening its circuit breaker.

ParameterTypeDescription
agentId *string
reason *string

ps_state_resume

Resume a halted agent.

ParameterTypeDescription
agentId *string
reason *string
resetMetricsboolean

ps_state_drift_history

Get drift history for an agent.

ParameterTypeDescription
agentId *string
limitnumber
sincenumberUnix timestamp

ps_config_set

Register a new policy overlay.

ParameterTypeDescription
overlay *object
overlayId *string

ps_config_activate

Activate a registered policy overlay.

ParameterTypeDescription
overlayId *string

ps_config_get

Get current configuration including active overlay and thresholds.

ps_config_export

Export current configuration for backup.

ps_config_import

Import configuration from backup.

ParameterTypeDescription
data *string
expectedChecksumstring

ps_confidence_set

Set a confidence threshold. This is the hidden knob for operators.

ParameterTypeDescription
threshold *string
value *number

ps_confidence_get

Get all confidence thresholds.

ps_confidence_bulk_set

Set multiple confidence thresholds at once.

ParameterTypeDescription
thresholds *object

ps_feature_set

Set a feature flag.

ParameterTypeDescription
enabled *boolean
flag *string

ps_feature_get

Get all feature flags.

ps_audit_get

Get audit log entries.

ParameterTypeDescription
actionstring
limitnumber
sincenumber

ps_parse

Parse a PromptSpeak EBNF expression into an AST. Returns AST tree and metadata (verb count, pipes, branches).

ParameterTypeDescription
expression *stringPromptSpeak expression (e.g., "::analyze{document}[security]|format:json")

ps_expand

Expand a PromptSpeak expression to natural English. Used by safety filters for human-readable action descriptions.

ParameterTypeDescription
expression *stringPromptSpeak expression to expand

ps_registry_lookup

Resolve a verb symbol to its full definition, including aliases.

ParameterTypeDescription
symbol *stringVerb symbol (e.g., "::analyze")

ps_registry_propose

Submit a new verb for review. Created with status: proposed.

ParameterTypeDescription
definition *stringSemantic definition of the verb
namespace *stringNamespace (e.g., "ps:custom")
symbol *stringVerb symbol (e.g., "::myverb")
categorystringVerb category
safety_classstringSafety classification

ps_registry_status

Check the lifecycle state and safety classification of a verb.

ParameterTypeDescription
symbol *stringVerb symbol to check

ps_registry_namespace

List all verbs registered in a namespace.

ParameterTypeDescription
namespace *stringNamespace to list (e.g., "ps:core", "ps:gov")

ps_registry_audit

Get full change history for a verb (registrations, transitions, updates).

ParameterTypeDescription
symbol *stringVerb symbol to audit

ps_registry_version

Get current spec version, verb count, and registry statistics.

ps_handshake_initiate

Start a PromptSpeak verification handshake. Returns probe expression to send to remote agent.

ps_handshake_respond

Handle an incoming PromptSpeak handshake probe. Parses, validates, and echoes confirmation.

ParameterTypeDescription
input *stringThe handshake probe expression to respond to

ps_capability_get

Report this server's PromptSpeak capabilities (version, verb count, namespaces).

ps_hold_list

List all pending holds awaiting human approval. Returns holds for risky operations that were blocked pending review.

ParameterTypeDescription
agentIdstringOptional: Filter holds by agent ID
includeExpiredbooleanInclude expired holds in the list (default: false)

ps_hold_approve

Approve a held execution request. The operation will proceed with optional modifications.

ParameterTypeDescription
holdId *stringThe hold ID to approve
executeNowbooleanExecute immediately after approval (default: true)
modifiedArgsobjectOptional: Modified arguments to use instead of original
modifiedFramestringOptional: Modified frame to use instead of original
reasonstringReason for approval (for audit trail)

ps_hold_reject

Reject a held execution request. The operation will not proceed.

ParameterTypeDescription
holdId *stringThe hold ID to reject
haltAgentbooleanAlso halt the agent that made the request (default: false)
reasonstringReason for rejection (for audit trail)

ps_hold_config

Configure hold behavior and thresholds. Controls when operations are held for human review.

ParameterTypeDescription
action *stringGet current config or set new config
configobjectConfiguration to set (only for action=set)

ps_hold_stats

Get hold statistics and history.

ParameterTypeDescription
historyLimitnumberNumber of historical decisions to return (default: 10)

ps_security_scan

Scan code content for security vulnerabilities. Returns findings classified by severity (critical, high, medium, low, info).

ParameterTypeDescription
content *stringCode content to scan
patternsarrayOptional: Only run these specific pattern IDs

ps_security_gate

Scan code and enforce security policy. Blocks on critical findings, holds high-severity for review, warns on medium, logs low/info.

ParameterTypeDescription
action *stringThe action being gated (e.g., "write_file", "edit_file")
content *stringCode content to scan

ps_security_config

Configure security detection patterns. List, enable, disable, or change severity of patterns.

ParameterTypeDescription
action *stringConfiguration action to perform
patternIdstringPattern ID to modify (required for enable, disable, set_severity)
severitystringNew severity level (required for set_severity)

ps_symbol_create

Create a new directive symbol in the registry. Symbol IDs follow the pattern: - Public companies: Ξ.{TICKER}.{PERIOD} (e.g., Ξ.NVDA.Q3FY25) - People: Ξ.I.{NAME}.{CONTEXT} (e.g., Ξ.I.JENSEN_HUANG.BIO) - Events: Ξ.E.{TYPE}.{ID} (e.g., Ξ.E.EARNINGS.NVDA.20241120) - Sectors: Ξ.S.{SECTOR}.{CONTEXT} (e.g., Ξ.S.SEMICONDUCTORS.2024) - Tasks: Ξ.T.{PROJECT}.{ID} (e.g., Ξ.T.PORTFOLIO_REVIEW.001) - Knowledge: Ξ.K.{DOMAIN}.{TOPIC} (e.g., Ξ.K.CHEMISTRY.WATER) - Queries: Ξ.Q.{DATASET}.{ID} (e.g., Ξ.Q.DEEPSEARCHQA.001)

ParameterTypeDescription
commanders_intent *stringUltimate goal in one sentence - the north star
how *object
requirements *arrayMUST include these elements
symbolId *stringUnique symbol ID following namespace rules (e.g., Ξ.NVDA.Q3FY25)
what *stringWhat is being analyzed or done
when *stringTime context
where *stringScope (company, market, geography)
who *stringWho needs this / who is the audience
why *stringWhy this matters / purpose
anti_requirementsarrayMUST NOT include these elements
categorystringCategory (auto-inferred from ID if not provided)
created_bystringCreator identifier
key_termsarrayTerms that MUST appear in output
parent_symbolstringParent symbol ID for hierarchical symbols
related_symbolsarrayRelated symbol IDs
tagsarrayFreeform tags for filtering

ps_symbol_get

Retrieve a directive symbol by ID. Returns the full symbol with all grounding context.

ParameterTypeDescription
symbolId *stringSymbol ID to retrieve (e.g., Ξ.NVDA.Q3FY25)
include_changelogbooleanInclude version changelog (default: true)
versionnumberSpecific version to retrieve (optional, defaults to latest)

ps_symbol_update

Update an existing symbol. Creates a new version with updated hash.

ParameterTypeDescription
change_description *stringDescription of what changed (for changelog)
changes *objectFields to update (who, what, why, where, when, how, commanders_intent, requirements, etc.)
symbolId *stringSymbol ID to update
changed_bystringWho made the change

ps_symbol_list

List symbols with optional filtering.

ParameterTypeDescription
categorystringFilter by category
created_afterstringFilter by creation date (ISO 8601)
created_beforestringFilter by creation date (ISO 8601)
limitnumberMax results (default: 50)
offsetnumberPagination offset
searchstringSearch in symbolId and commanders_intent
tagsarrayFilter by tags

ps_symbol_delete

Delete a symbol from the registry.

ParameterTypeDescription
reason *stringReason for deletion
symbolId *stringSymbol ID to delete

ps_symbol_import

Bulk import symbols from external data (HuggingFace, JSON, etc.).

ParameterTypeDescription
category *stringCategory for imported symbols
data *The data to import (format depends on source)
id_prefix *stringPrefix for generated symbol IDs (e.g., Ξ.Q.DEEPSEARCHQA)
source *stringData source format
defaultsobjectDefault values for fields not in source data
transformobjectField mapping from source data to symbol fields

ps_symbol_stats

Get statistics about the symbol registry.

ps_symbol_format

Format a symbol for inclusion in a prompt. Returns LLM-ready text.

ParameterTypeDescription
symbolId *stringSymbol ID to format
formatstringFormat style (default: full)

ps_symbol_verify

Record human verification of a symbol claim. Use this tool to upgrade or dispute claims based on human review: - VERIFIED: Human expert has confirmed the claim is accurate - CORROBORATED: Additional evidence supports the claim - DISPUTED: Human reviewer found the claim to be incorrect or misleading Important: Accusatory claims (fraud, violations) should be DISPUTED if they lack evidence or have plausible alternative explanations.

ParameterTypeDescription
new_status *stringNew epistemic status for the claim
reviewer *stringIdentifier of the human reviewer
symbolId *stringSymbol ID to verify
evidence_addedarrayList of evidence sources that support this verification
new_confidencenumberNew confidence level (0-1). Auto-calculated if not provided.
notesstringNotes explaining the verification decision

ps_symbol_list_unverified

List symbols that require human review. Returns symbols flagged for review due to: - Accusatory claims without sufficient evidence - Missing alternative explanations - High-stakes claims (fraud, violations, diagnoses) - Low confidence scores Use this to find claims that need human validation before action.

ParameterTypeDescription
claim_typestringFilter by claim type (e.g., ACCUSATORY for fraud allegations)
limitnumberMaximum results to return (default: 50)
max_confidencenumberMaximum confidence level to include
min_confidencenumberMinimum confidence level to include
offsetnumberPagination offset

ps_symbol_add_alternative

Add an alternative explanation to a symbol's findings. CRITICAL for preventing false positives: When a pattern-based finding could have multiple explanations, document them here. Adding high-likelihood alternatives automatically reduces confidence in the original claim. Examples: - "9 identical payments" → Alternative: "Monthly insurance premium financing" - "Large round numbers" → Alternative: "Negotiated contract amounts" - "Vendor with single customer" → Alternative: "Subsidiary company"

ParameterTypeDescription
added_by *stringWho is adding this alternative
alternative *stringDescription of the alternative explanation
likelihood *numberEstimated likelihood this alternative is correct (0-1)
symbolId *stringSymbol ID to update
reasoningstringWhy this alternative is plausible