v0.2 · November 2026

Managed Integration & Credential Protocol

A protocol for one server that connects many services, and never lends the agent the keys

Abstract

MICP is a protocol for an integration server: one server that holds connections to many services (Google, Microsoft, Stripe, Telegram, a spreadsheet, a mailbox) and performs calls on their behalf. Software agents are now asked to act on those systems: send mail, publish video, write rows into a spreadsheet. The usual way to grant that access is to hand the agent a credential (a token, a password, an API key) and to hope that the transcript stays private. In it, an agent never holds a credential. Integrations declare what exists; accounts hold the secrets, encrypted under a single vault key and enable the methods they may use; and every call is scoped and recorded. We separate what a protocol must specify from what an implementation may choose, and we show that the same rules serve an agent, a scheduled job and a back-end service without change.

Keywords: agent tooling, credential management, least privilege, declarative integration, audit

agent calls a method client asks what exists integration server vault · accounts · methods gmail stripe the vault key stays here The agent asks. The server answers with an action. The key never travels.
Figure 1. The whole protocol in one drawing: one server holds many integrations; the client asks what exists; the agent chooses a method; the server performs the call. The vault key stays behind, outside the database and outside every conversation.

The centre of the picture is the integration server: one server that holds many integrations. An integration is a type of service, such as email, messaging or spreadsheets. Inside each integration there are accounts, one per connection, each with its own credential. And each account enables the methods it is allowed to use. One server, many integrations, several accounts per integration, a few methods per account.

Two roles sit around it. The client is the software that talks to the server: it asks what exists, and presents each method to the model as a tool. It may be a chat application, a workflow engine, an editor or a command line. The agent is the model inside that client, choosing among the methods and asking for an action. The protocol constrains what the server declares and how a call is authorised; it says nothing about who builds the client or in what language.

1Introduction

This paper describes the server that sits behind the agent: one integration server, holding the integrations an operator has installed, each with its accounts and the methods those accounts may use. It is not a library and not a framework. It is a place where credentials live and calls are decided.

An agent needs to send an email. The easy way is to paste an application password into the chat. It works. For about three weeks, nobody notices anything.

Then the account is used by someone else. Or the password is changed at the provider. Or a support ticket arrives with the whole conversation attached. The password now lives in four places: the chat, the provider's logs, the client's history, and whatever the user pasted it into. None of them is where it should be.

There is a second problem behind the first. A password is not a permission. A mail password that lets you send is also a key to read every message, delete folders and change settings. Saying send this email hands over much more than the sentence says. And because the password travels with the agent, nothing can check whether this one action was allowed.

Tool-calling protocols made this better. They move the password out of the chat and behind a tool. That fixes the first problem. The second stays: a tool is either visible to the model or it is not, and who may call what lives in the client, if it lives anywhere. The record of what happened is whatever the client chose to keep.

MICP describes the layer below. The unit that matters is not the integration but the method on a specific account. Passwords belong to a vault, not to a caller. Permission is data, not a property of a key.

Section 2 gives the model. Section 3 covers keys. Section 4 shows a call. Section 5 explains discovery. Section 6 describes how to build a client. Section 7 lists the conformance checks. Section 8 separates what is implemented from what is planned. Section 9 relates this layer to other tool-calling standards.

2The model

Three nouns, and one rule for each:

integration gmail account elizeu account support send for elizeu read · mark_read for support One contract per method; the account only chooses which credential executes it.
Figure 2. The three nouns. Twenty accounts sharing six methods produce six contracts, not a hundred and twenty. And a method is enabled per account, so one mailbox may send while another may also read.

A method is declarative: an endpoint, a request template, an input schema and an optional output map. It contains no code. The executor is written once and interprets the declaration, which is why adding an integration is a configuration change rather than a deployment, and why a pack can be reviewed by reading it.

{
  "micp": "0.2",
  "integration": "email",
  "description": "Send email from a mailbox.",

  "defaults": {
    "smtp_host": "smtp.gmail.com",
    "smtp_port": 465,
    "tls": "implicit"
  },

  "accounts": [
    { "account": "elizeu",
      "config":  { "email": "[email protected]" },
      "custom":  { "assinatura": "Elizeu Carlos" },
      "secrets": { "app_password": "{{vault:email.elizeu.app_password}}" } },

    { "account": "suporte",
      "config":  { "email": "[email protected]", "smtp_port": 587, "tls": "starttls" },
      "custom":  { "assinatura": "Equipa de suporte" },
      "secrets": { "app_password": "{{vault:email.suporte.app_password}}" } }
  ],

  "methods": {
    "send": {
      "description": "Send an email from the selected account.",
      "transport": "smtp",

      "endpoint": {
        "host": "{{defaults.smtp_host}}",
        "port": "{{account.smtp_port | default:defaults.smtp_port}}",
        "tls":  "{{account.tls       | default:defaults.tls}}"
      },

      "request": {
        "auth":    { "user": "{{account.email}}", "password": "{{secret.app_password}}" },
        "from":    "{{account.email}}",
        "to":      "{{input.to}}",
        "subject": "{{input.subject}}",
        "body":    "{{input.body}}\n\n{{account.custom.assinatura}}"
      },

      "fields": {
        "to":      { "type": "email", "required": true },
        "subject": { "type": "text",  "required": true, "max": 200 },
        "body":    { "type": "text",  "required": true }
      },

      "output": { "sent": "constant:true", "message_id": "smtp.message_id" }
    }
  },

  "destinations": ["{{defaults.smtp_host}}"]
}

Configuration lives at three levels, and the method is written once for all of them. That is what makes a second account a row of data instead of a second integration.

Table 2. Where a value comes from.
In the templateSourceVisible to
{{defaults.x}}the integration defaults, shared by every accounteveryone
{{account.x}}a field of the account, in configdiscovery, UI, logs
{{account.custom.x}}a user-defined extra, in customdiscovery, UI, logs
{{secret.x}}the vault, decrypted for the duration of the callnobody
{{input.x}}a field declared in fields and sent by the callerthe caller

The rule for placing a value is one question: if this appeared in a screenshot or in the discovery response, would it grant access? If yes, it belongs in the vault. If no, it belongs to the account. Nothing else decides.

Two consequences follow. First, the account is a parameter of the method, never a free string: the caller picks from a list, so a model cannot invent a mailbox. Second, a secret is a reference, never a value: the pack can be shared, reviewed and kept in a repository.

3Keys

MICP has two kinds of key, and they answer different questions. Provider keys belong to the services, and there are many. The vault key belongs to the installation, and there is one.

Table 1. Keys in a MICP deployment.
KeyCountFunctionLeaves the server
Vault keyone per installationencrypts and decrypts stored credentialsnever
Account credentialone per accountwhat the provider issuedonly on the outbound call
Access tokenone per callerwho may call which methodto that caller

The vault key is the only secret an operator has to keep, rotate and back up. It does not authenticate anyone and it does not grant anything: it opens a store. Permission is a property of the deployment, not of the key: what an account may do is decided where the account is enabled, and the key only opens the store. It is a plain pair of keys: one private key that decrypts, one public key that encrypts. Two files, two lines of configuration, no special format: X25519 to agree a secret, AES-256-GCM to seal each value, and the record's address mixed into the authenticated data. Three commands cover its whole life: keygen, verify and rotate.

integration server executor vault vault key opens database ciphertext · nonce · tag accounts · audit only ciphertext crosses
Figure 3. The vault key lives outside the database. A stolen dump contains ciphertext, account names and account rows, and no usable secret.

3.1 Storage and retrieval

A credential is encrypted before it touches disk, with a random nonce per record and the record's address bound into the authenticated data: installation, integration, account, field. Copying a row into another account therefore fails to decrypt, which turns a database write into a non-event.

i store the credential arrives encrypted before disk ii ask the agent calls inputs and a signature iii open the server checks the account, then decrypts iv call the provider acts one call, then a record The plaintext exists between iii and iv, in memory, for the duration of one call.
Figure 4. The plaintext exists between iii and iv, in memory, for the duration of one call.

Rotation replaces the vault key without re-asking anyone for anything: a new key is generated alongside the old, new writes use it, a background pass re-encrypts the remaining rows, and the old key is retired when no row refers to it. Rotation bounds the damage of a key copied without the operator's knowledge; it does not stop an attack in progress, which is a matter for revocation.

4Calls

A call carries a method, an account, the inputs, and a signature over the exact bytes. Two questions get two different answers, and mixing them produces systems that authenticate and never authorise.

The signature says whether the request is genuine and unchanged. It covers the body, a timestamp and a nonce, so a replay is visible and useless. What an account may do is decided when the account is enabled: a method that is not enabled is not announced. A request for one is a well-formed refusal.

POST /v1/call/email.elizeu.send
Authorization: Bearer <access token>       # who is calling, and only that
Content-Type: application/json

{ "input": { "to": "[email protected]",
             "subject": "Relatório",
             "body": "Segue em anexo." } }
caller caller integration server verifies · decrypts · executes provider gmail · stripe 1 signed request 2 verify signature 3 check timestamp and nonce 4 check the account 5 open the vault 6 credential + request 7 provider response 8 mapped output, or a typed error plaintext dropped · audit row written
Figure 5. The caller sees steps 1 and 8. Steps 2 to 7 happen behind the counter, and only step 6 leaves the server, carrying the provider credential, never the vault key.

Errors are typed rather than free text: invalid input, vault unavailable, not authorised, provider failure, idempotency conflict. A caller can therefore react deterministically, and an operator can count failures by kind. Idempotency is keyed by the caller's request identifier and attempt, so a retry after a crash does not send the same email twice.

4.1 Three calls, end to end

caller agent inside POST /v1/call/… over HTTPS integration server enablement · vault · template HTTP in, transport out SMTP 587 STARTTLS provider gmail.com the key stays here
Figure 6. Two hops, never more. The caller speaks HTTP to the integration server; the server speaks the provider's own transport. Between them sit enablement, the vault and the rendered template, and the key never comes back up the wire.

The call carries the method in its name. Three groups, always in this order: integration.account.method. The body carries only the inputs.

POST /v1/call/email.elizeu.send
Content-Type: application/json

{ "input": { "to": "[email protected]",
             "subject": "Relatório",
             "body": "Segue em anexo." } }

What the integration server does with it, with the secret masked:

defaults.smtp_host            smtp.gmail.com
account.smtp_port             465        (from defaults, no override)
account.email                 [email protected]
account.custom.assinatura     Elizeu Carlos
secret.app_password           ***

CONNECT smtp.gmail.com:465  implicit TLS
AUTH  [email protected]  ***
MAIL FROM: [email protected]
RCPT TO:   [email protected]
DATA
  Subject: Relatório

  Segue em anexo.

  Elizeu Carlos

The same method, called on the other account, produces a different request with no change to the pack: the second account overrides smtp_port and tls, and brings its own signature and its own secret.

POST /v1/call/email.suporte.send
{ "input": { "to": "[email protected]", "subject": "Bilhete #4821", "body": "Em análise." } }

CONNECT smtp.gmail.com:587  STARTTLS      ← override da conta
AUTH  [email protected]  ***

A third call, on a service that uses an HTTP API and a custom field, shows the same shape applied elsewhere. Here the pack reads a destination from defaults, a channel from the account, a tone from the user-defined extras, a token from the vault, and three fields from the caller.

POST /v1/call/telegram.canal_curso.send
{ "input": { "text": "Episódio 12 no ar", "silent": false } }

→ POST https://api.telegram.org/bot***/sendMessage
  { "chat_id": "-100123456",                 ← {{account.chat_id}}
    "text": "Episódio 12 no ar",             ← {{input.text}}
    "parse_mode": "Markdown",                ← {{account.custom.formato}}
    "disable_notification": false }          ← {{input.silent}}

Nothing in these three calls required a line of code per integration. What changed between them was data: an override here, a custom field there, a different transport in the third.

4.2 What comes back

Describing the response is optional. If a method has no output, the provider's answer comes back as it arrived. That is the default, and it is what you want while you are building the integration.

If the method declares output, only the listed fields come back, each with a type:

"output": {
  "message_id": { "path": "body.id", "type": "text", "required": true },
  "accepted":   { "path": "smtp.accepted", "type": "list" }
}

output chooses and checks. It does not transform: no renaming, no date arithmetic, no joins. If you need that, do it where you call, not inside the pack.

Two optional marks per field handle the two ways a response can disappoint you. default covers a field that did not come: the server returns the default instead of failing. expected covers a field that came with the wrong value: the call fails, because a response that says ok: false is not a success even when the HTTP status is 200.

"output": {
  "ok":   { "path": "body.ok",   "type": "boolean", "expected": true },
  "chat": { "path": "body.chat", "type": "text",    "default": "" }
}

When expected fails, the answer is a typed error, not a value the caller has to interpret:

{ "ok": false, "error": "resposta_inesperada",
  "campo": "ok", "esperado": true, "recebido": false,
  "efeito_possivel": true, "tentavel": false }

efeito_possivel matters: the provider answered 200, so the action may have happened. It is not an error to retry blindly; it is one to check first.

One exception is worth spelling out. A few services return a new credential in the response, a refresh token being the usual case. If the answer carries a field whose name matches a secret already stored for that account, the server stores it in the vault, encrypted, and returns {"stored": true} in its place. The value never leaves the server. Most integrations never do this, and for them it costs nothing. Large responses are cut at 64 KB.

5Discovery

A server that exports everything exports too much. Discovery answers only with what the server has enabled, and the filtering happens on the server, before the caller sees anything.

A method the caller cannot use is not refused later. It never appears. The difference is not cosmetic. A refusal tells the agent that something exists and invites a second attempt; invisibility leaves nothing to try. It also keeps prompts small, which is why most deployments end up doing this anyway.

server catalogue everything installed enabled on the server what this client bought visible to the agent enabled per account A method the caller cannot use is not refused later: it never appears.
Figure 7. Two filters in series. Neither happens in the model, and neither requires the caller to be trusted.

Because the announcement contains no secrets (names, descriptions, schemas), it can be served freely, cached and shown in a user interface. It is a menu, not a key.

5.1 The discovery response

A caller asks the server what exists:

GET /v1/discovery
{ "micp": "0.2",
  "integrations": [
    { "integration": "email",
      "accounts": [
        { "account": "elizeu",
          "methods": [
            { "name": "email.elizeu.send",
              "description": "Send an email from the selected account.",
              "input":  { "to": {"type":"email","required":true},
                          "subject": {"type":"text","required":true,"max":200},
                          "body": {"type":"text","required":true} },
              "output": { "sent": {"type":"boolean","expected":true},
                          "message_id": {"type":"text"} } },
            { "name": "email.elizeu.list", … }
          ] },
        { "account": "suporte", "methods": [ … ] }
      ] },
    { "integration": "telegram",
      "accounts": [ { "account": "canal_curso", "methods": [ … ] } ] }
  ] }

Three levels, in the order a person thinks about them: the integration, the accounts inside it, and the methods each account may use. A method carries four keys: name, description, input and output.

The name is repeated at every level on purpose. It could be assembled from the three parts, but a caller that has to concatenate strings eventually concatenates them wrong. Given the name, it copies it.

There are no paths, no headers, no transport and no endpoint in this response: those belong to the pack and never leave the server. The list contains only what is installed and enabled. A credential grants access to the server; how a deployment organises tenants, roles and interface is left to the implementation.

The same data can be rendered as a compact block for a prompt, with ?target=text. Any other value is refused with alvo_invalido, so a typo surfaces on the first attempt instead of in a client three weeks later.

6Implementation

A model does not need a protocol to get tools. It needs a name, a description and a JSON schema. Whoever builds that list is the client, and building it is the work this section describes.

  1. Place the vault. In the same process, or on a separate integration server. If separate, the client records a URL and the two sides pair once with a short-lived code that carries the server's address.
  2. Expose discovery. The server answers what is installed and enabled: accounts, methods, input and output schemas, filtered as in Section 5.
  3. Cross with enablement. Keep only the methods enabled for that account. This happens before the model is prompted, not after it tries.
  4. Translate into tools. One tool per account and method, with a stable name, a natural-language description and the fields as a schema. The account is folded into the name so that it cannot be invented.
  5. Forward calls. When the model selects a tool, send POST /v1/call/{integration}.{account}.{method} with the inputs, verify the result and return the mapped output.
  6. Install the pack. An integration is one file on the server. Drop packs/<integration>.micp.json and reload: nothing else to build, nothing to deploy.

6.1 Building an integration

An integration is a file, not a program. The pack says what the methods are; the server reads it and does the work. There is no build step, no package to install and no code to review line by line: you read the file, and you know what the integration can do.

To make that concrete, there is a builder at micpprotocol.com/builder.html. Four steps: the integration and its defaults, the accounts, the methods, and the JSON. It shows the request that will be sent, with the secret masked, and gives you the file to drop on your server. Instructions for connecting an agent are on the Agent page.

What it will not do is the interesting part. There are no conditions, no loops, no expressions and no code inside a pack. If a service needs logic to be called, it needs a new transport or it waits. A refusal is easier to audit than a language.

Announcing everything is simpler to build and easier for a model to use. It also costs context on every call. That is a product decision, not a protocol one, and it can be changed per account, which is why enablement belongs to whoever operates the server.

7Conformance

An implementation conforms to MICP v0.2 if it satisfies the following. The list is deliberately short: every item can be checked by reading a pack or by issuing a request.

The reference implementation meets ten of these twelve. Items 8 and 9 are specified and not yet built; they are listed here because the protocol requires them, and because a reader deserves to know which promises are still open.

  1. A method is one operation, with an input schema. Its output schema is optional.
  2. Every method names a transport from {http, smtp, imap}.
  3. Secrets are referenced, never embedded: {{vault:integration.account.field}}.
  4. No pack contains a credential, in any form, including examples.
  5. Every integration declares an allowlist of destinations.
  6. Discovery returns only what is installed and enabled on that server.
  7. A caller can only call what discovery announced.
  8. Every call is idempotent per request identifier and attempt.
  9. Calls carry a timestamp and a nonce; replays are rejected.
  10. Errors are typed, and the type is stable across versions.
  11. The vault key is stored outside the database, with a separate backup and a tested restore.
  12. Every call is recorded: account, method, caller, outcome, duration.

8Status of this document

This document describes a protocol that is partly implemented. The difference matters, so it is stated rather than implied.

Table 3. Implemented and intended, as of v0.2.
ElementStateNote
Declarative methodsimplementedtransports http, smtp, imap
Accounts as dataimplementedmethods enabled per account
Grants per methodnot in 0.2one access level per server; scoping is left to the implementation
Filtered discoveryimplementedonly installed and enabled methods appear
Audit of callsimplementedaccount, method, caller, outcome
Vault, X25519 and AES-256-GCMimplementedkeygen, verify and rotate; one key per installation
Discovery endpointimplementedGET /v1/discovery, JSON and text
Idempotency per requestnot in 0.2a retry after a crash can repeat a call
Signed calls with noncein progressscoped tokens shipped; body signature next

The protocol is specified carefully because the failure is expensive: a password handed to an agent cannot be taken back. A feature written down but not built is a promise; a feature built but not written down is a rumour. The table keeps both visible.

9Beyond agents

Nothing in this protocol assumes a model. A nightly job that publishes a report, a back end that sends an invoice when an order ships, a command line a person uses by hand: each of them is a caller, and each is authorized and recorded in the same way.

The agent case is what forced the design, because an agent can invent a call and a model cannot be trusted with a key. But the rules it produced are not agent rules. A deterministic program that knows exactly which method it wants benefits from the same three properties: the secret stays in the vault, the method is declared rather than coded, and the call leaves a record.

A caller needs two things: the server's address and a credential. It does not need a model, a framework, or an SDK. That is why the protocol is specified as HTTP and JSON: a cron entry with curl is a first-class caller, and so is a compiler with a generated client.

The same holds for the other direction. A deployment that already has its own scheduler does not have to adapt to an agent framework to use this: it calls POST /v1/call/{integration}.{account}.{method} and reads {ok, output}. Whether a model, a queue worker or a person asked for it is a detail the server records and does not need to know.

About the author

Elizeu Carlos

Senior software engineer · front end and back end · mentor

Elizeu Carlos is a senior software engineer who works across the front end and the back end of the stack. He spends as much time explaining complex topics such as infrastructure, blockchain, networks and cloud as he does building them, and that habit of explaining is what produced this paper.

The question behind it is simple. Giving an agent a credential is easy to build and impossible to defend: the key ends up in a transcript, the permission covers far more than the task, and nobody can say afterwards what was done with it. MICP is the layer he wanted underneath that problem.

Elizeu Carlos