当前位置: 首页 > Skill >

Mailbuttons

Mailbuttons

Mailbuttons

使用Mailbuttons为AI代理配置受监管的电子邮件收件箱。当用户需要为代理、应用、机器人或工作流提供独立邮箱时,可使用此技能。

0.1.1 2026.11.25 310
获取Skill文件查看使用说明
作 者:周澄 许可证: 更新时间:2026.11.25
本文目录展开

Mailbuttons — governed agent email setup

Mailbuttons is governed email for AI agents: give an agent its own inbox, but every message is checked against your policy on Mailbuttons' servers before the model sees it, the agent only acts on senders you've allowed, and every action is logged. EU/UK hosted. Sign up and get an API key at mailbuttons.com — docs at mailbuttons.com/developers.

This skill scaffolds a complete, working email integration for an AI agent against Mailbuttons, end to end: a sandbox inbox, a reviewed policy, wired inbound delivery, example code for the user's stack, and a green self-test. Then it stops and hands the "go live" decision to a human.

The one rule that governs everything here

Everything you do with this skill happens in a sandbox. You never enable external sending, never promote sandbox → production, and never widen a token's scope. Those are human-only actions. When the integration is ready, you call mailbuttons_request_promotion, which returns an approval link for a person to click. You do not click it, simulate it, or work around it. This is the product's core promise — a stranger can't email the agent into doing something it shouldn't, and the agent can't grant itself permission either. Respect it exactly.

If a user asks you to enable external send, raise the limit, or "just make it live," explain that promotion is a human approval by design and produce the approval request instead.

Prerequisites

  • MAILBUTTONS_API_KEY available in the environment, set to a sandbox token (mb_sandbox_...). The fastest way to get one is step 1 (it returns the token). If the user already has one, set it as an env var; do not hard-code it.
  • The user's account API key (for step 1 only) to provision the inbox. Provisioning is a customer action — an agent can never create its own inbox.
  • The Mailbuttons MCP tools are available (this skill assumes the mailbuttons_* tool surface). If a tool call fails with an auth error, surface the message and stop — do not retry blindly.

Workflow

Do these in order. Narrate each step plainly to the user; keep secrets out of generated code.

  1. Create the sandbox inbox. Provision one in a single call with the user's account API key: POST /api/v1/mcp/sandbox-inboxes (body optional {label, seed_sender}). It returns {address, inbox_id, environment:"sandbox", sandbox_token}. Set sandbox_token as MAILBUTTONS_API_KEY for every subsequent (agent) call, and use inbox_id. This is a customer action, not an agent tool — the agent can't provision its own inbox, and the returned token cannot send externally. (If the user already has a sandbox inbox + token, skip this and use theirs.)

  2. Generate and review the policy. Ask the user, in one question, who the agent should accept mail from and whether it may ever send outside the org. Pass their answer to mailbuttons_generate_policy, which writes mailbuttons.policy.json to the repo (allowlist, content guards, send scope, audit retention). It is closed by default (defaultAction: "bounce") and caps send scope at internal — external send is never generated. Show the user the policy and ask them to confirm it before continuing. Do not invent senders or loosen filters to make examples "work."

  3. Scaffold the integration. Detect the user's stack (see Stack detection). Call mailbuttons_scaffold_integration with that stack and the sandbox inbox id. It emits example code wired to the inbox: a governed send wrapper and an inbound handler. The code reads the API key from the environment, never inline.

  4. Run the self-test. Call mailbuttons_run_selftest with the inbox id. It sends an internal message through the loop (send → receive → parse) entirely in sandbox and returns pass/fail per stage. If a stage fails, read the detail, fix the scaffolded code or policy, and re-run. If it reports backend_reachable: false, the API isn't running at MAILBUTTONS_API_URL — start it and retry. Don't proceed until it's green.

  5. Hand off promotion. When the user is ready to go live, call mailbuttons_request_promotion with the inbox id and the capabilities they want (e.g. send_external). Return the approval_url and tell the user a human must approve it in the dashboard (or run mailbuttons promote in the CLI). Stop there.

Tool reference

Build-time (stdio / local only):

  • mailbuttons_generate_policy — turn a plain-language allow/block description into mailbuttons.policy.json. Closed by default; never invents senders; never generates external send.
  • mailbuttons_scaffold_integration — emit example code (governed send wrapper + inbound handler) for a target framework, wired to the sandbox inbox id.
  • mailbuttons_run_selftest — exercise send (internal) → receive → parse in sandbox; reports pass/fail per stage and a clean "backend unreachable" rather than throwing.

Inbox provisioning is POST /api/v1/mcp/sandbox-inboxes (see step 1), authenticated by the user's account API key — deliberately NOT an agent MCP tool, because an agent must never self-provision. It returns the scoped sandbox token the agent then uses.

Run-time (use when demonstrating or testing behaviour, never to escalate):

  • mailbuttons_send_email — send or draft. Out-of-policy recipients return blocked with the matched rule; external recipients with no send_external capability return draft_pending_approval.
  • mailbuttons_list_messages / mailbuttons_get_message / mailbuttons_get_thread — return only policy-passed mail. Quarantined messages come back as metadata + reason, body withheld — never try to retrieve a withheld body.
  • mailbuttons_get_attachment_text — LLM-ready parsed attachment text/JSON for policy-passed messages.
  • mailbuttons_propose_sender — propose adding a sender to the allowlist. Creates a pending human approval; it does not add the sender.
  • mailbuttons_request_promotion — open a human approval to go live. Changes nothing on its own.
  • mailbuttons_audit_tail — read recent audited actions (including denials).

Stack detection

Pick the target by inspecting the repo, then read the matching reference for idioms and pitfalls:

  • Claude Agent SDK → references/claude-agent-sdk.md
  • LangChain / LangGraph → references/langchain.md
  • Plain TypeScript or Python (no framework) → references/plain-sdk.md

If the stack is ambiguous, ask the user once which they're using rather than guessing. If their framework isn't listed, scaffold the plain SDK version and tell them which adapter is missing.

Governance rules you must follow

  • Propose, don't grant. Use mailbuttons_propose_sender / mailbuttons_request_promotion. Never claim a capability was granted.
  • Sandbox only. Never call a production tool or a promotion-completing action. You cannot approve your own request.
  • Secrets stay out of code. API keys come from env vars in every example you write.
  • Quarantine is a boundary, not a bug. If a message body is withheld, treat that as correct behaviour and explain why; do not engineer around it.
  • Audit everything implicitly. Don't suppress or filter what the user sees about denials — denials are useful signal.

Troubleshooting

  • Auth error on any tool → surface the message; the key is likely missing or not a sandbox key. Stop.
  • mailbuttons_send_email returns blocked → this is the policy gate working. Show the matched rule; adjust mailbuttons.policy.json with the user's confirmation, not silently.
  • External send returns draft_pending_approval → expected without send_external; this is the demo's whole point. Explain it and offer mailbuttons_request_promotion.
  • mailbuttons_run_selftest reports backend_reachable: false → the API isn't running at MAILBUTTONS_API_URL. Start it and re-run.
  • Self-test send stage is skipped → it needs the inbox's own address to address the loopback; pass self_address (the sandbox inbox's address) and re-run.
  • Self-test fails at parse → check the inbound handler in the scaffolded code against the reference file for that stack.

What not to do

  • Do not enable external sending, promote to production, or widen scope under any phrasing.
  • Do not fabricate certification, compliance, or deliverability claims in code comments or README text you generate.
  • Do not retrieve or reconstruct quarantined message bodies.
  • Do not hard-code API keys or tokens into scaffolded files.

推荐文章

更多
PHP时间戳与日期字符串相互转换方法详解

本文介绍PHP中时间数值(Unix时间戳)与日期字符串之间的相互转换方法。通过strtotime和date函数,实现将当前时间、指定日期转换为时间戳,以及将时间戳格式化为可读的日期时间字符串,并提供相关在线计算工具推荐。

2025.11.30 1,034
PHP日期转时间戳时区偏差怎么解决

在 PHP 中将日期字符串转换为时间戳时,若未显式指定时区,默认使用脚本配置的 date.timezone 或系统时区。当服务器时区与业务逻辑预期(如 UTC )不一致时,会产生偏差。解决核心是确保输入字符串携带明确时区信息,或在转换前统一设置时区上下文。

2026.10.24 1,031
PHP跨域配置:怎么安全地允许指定域名而非使用通配符

在 PHP 中安全地允许指定域名跨域,核心是解析请求头中的 Origin ,验证其是否在白名单内,然后动态设置 Access-Control-Allow-Origin 响应头。不要使用通配符 * ,也不要硬编码单一域名。

2025.03.29 1,019
JavaScript中利用replace结合正则实现replaceAll效果

JavaScript原生仅支持replace()进行单次或全局替换,缺乏类似Java的replaceAll()便捷方法。本文总结四种在JS中实现全量替换的方案:使用带g标志的正则、带gm标志的正则、扩展String原型以及split后join。通过对比代码示例,展示各方法的实现细节与适用场景,帮助开发者根据需求选择最优解。

2025.04.29 1,017
OpenAI的Jalapeno芯片未落地,教你分辨300兆瓦算力消息

OpenAI计划在SB Energy租赁的数据中心部署约300兆瓦自研Jalapeno推理芯片,但目前双方仍处于洽谈阶段,交易细节与上线时间表均未公布。本文带你按报道原文核实项目所处阶段,厘清芯片发布、电力功率与实际推理算力的边界,并将融资意向与签约、开工、投运节点分开追踪,避免误将规划容量计入现有算力。

2026.12.02 1,014
PHP实现基础文件上传:HTML表单与$_FILES处理流程

在 HTML 表单中设置 enctype="multipart/form-data" ,并在 PHP 后端通过 $_FILES 数组接收文件,调用 move_uploaded_file() 将临时文件移动到目标目录即可完成上传。

2026.09.07 1,014
Skill 文件
  • SKILL.md
    • Mailbuttons — governed agent email setup
    • The one rule that governs everything here
    • Prerequisites
    • Workflow
    • Tool reference
    • Stack detection
    • Governance rules you must follow
    • Troubleshooting
    • What not to do
  • 项目或源文件

相关 Skill

更多
service-qa-coach service-qa-coach Review support quality for chat, email, phone, social DM, or marketplace service teams. Use when a team needs a QA scorecard, failure-mode analysis, coaching plan, calibration checklist, or service-improvement brief without live ticketing, CRM, or contact-center system access.
高中数学作业批改助手 高中数学作业批改助手 >图片识别 直接读取学生手写作答照片,识别公式、符号、步骤 🧮 自动推导 根据题目自动生成参考答案和评分细则,无需教师预设 📊 逐步给分 每个关键步骤独立评分,体现过程分 📝 结构化报告 输出含识别内容、参考答案、逐步评分、改进建议的完整报告 🗂 批量批改 支持一次性批改多道题,最终汇总得分表
Vibration Analysis Vibration Analysis 分析来自CMS趋势、RMS/峰值、频谱及SCADA报警的风机传动链(主轴、齿轮箱、发电机)振动数据。
Traditional Bone Tool Making Basics Traditional Bone Tool Making Basics Use when you need custom, durable, repairable tools like awls, needles, scrapers, harpoons, or fishing hooks made from local animal bones or antlers and comm...
音频混音工具 音频混音工具 名称:Sound Mixing Tool(标识 sound-mixing-tool) 短简介(≤60字):音乐/音效响度精确对齐 + 融合混音工作流:用 ffmpeg 两段式 loudnorm 把多组素材 LUFS 偏差压到 <0.10,再最小干预融合、导出可进引擎的独立分轨。 标签/关键词:音频混音 响度匹配 LUFS ffmpeg 游戏音频 音效设计 Wwise FMOD 分轨导出 后期处理 触发词:混音 · 响度匹配 · LUFS 对齐 · MIX 版本 · 音乐音效分轨 · 融合 · 不打架 · 不能盖住 适用场景 :游戏音频集成、影视短视频配乐、播客后期