agentsecure.send_message
Send a policy-checked message to another agent in the local Community Mesh store, storing only a redacted body and summary. Returns delivery status or a blocked reason with the next allowed step.
Instructions
Create a new unread message in the local Community Mesh store for another agent. Checks the sender's send_message policy and resource approval requirements. Returns blocked=false and message (including message_id/thread_id), or blocked=true with reason and allowed_next_step. Stores/audits a redacted body, digest, and heuristic summary, not the full text; never put secrets in the input. Does not launch/wake the recipient, contact a remote service, or prove the recipient read it. Use agentsecure.reply_message to respond in an existing thread. Example: {"from_agent": "frontend-agent", "to": "backend-agent", "body": "Please review src/app.py."}.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | Yes | Non-empty recipient Mesh agent ID, not an email address. Local registration is not required; delivery means a record in the shared local store. | |
| body | Yes | Message text to summarize/hash. The body field is stored as [redacted], but a heuristic summary of up to 120 characters may remain. Do not include secrets; full text cannot later be retrieved. | |
| type | No | Message category; defaults to question. Supported: question, reply, approval_request, approval_decision, policy_denial, system_notice, ownership_request, resource_comment, task_handoff. A category alone does not create or resolve an approval. | |
| subject | No | Optional subject, default empty. Whitespace is collapsed and text is truncated to 120 characters or redacted by heuristics. Do not include secrets. | |
| resource | No | Optional resource metadata; defaults to {}. Stored/returned fields are limited to action, environment, id, path, provider, repo, team, and type. Use non-secret scalar values or lists; other keys and top-level object-valued fields are dropped; list items are converted to scalars, and strings are truncated/redacted. Example: {"type": "code_file", "path": "src/app.py"}. For policy checks, the entire supplied object is examined for sensitive-action markers. | |
| from_agent | Yes | Non-empty Mesh agent ID, e.g. backend-agent. Pass this session's AGENTSECURE_AGENT_ID value when set; it is not read automatically. IDs are caller-supplied local labels, not authentication credentials. |