Freigeben über


AgentInstance erstellen

Namespace: microsoft.graph

Wichtig

Die APIs unter der /beta Version in Microsoft Graph können sich ändern. Die Verwendung dieser APIs in Produktionsanwendungen wird nicht unterstützt. Um festzustellen, ob eine API in v1.0 verfügbar ist, verwenden Sie die Version Selektor.

Erstellen Sie ein neues agentInstance-Objekt .

Diese API ist in den folgenden nationalen Cloudbereitstellungen verfügbar.

Weltweiter Service US Government L4 US Government L5 (DOD) China, betrieben von 21Vianet

Berechtigungen

Wählen Sie die Berechtigungen aus, die für diese API als am wenigsten privilegiert markiert sind. Verwenden Sie eine höhere Berechtigung oder Berechtigungen nur, wenn Ihre App dies erfordert. Ausführliche Informationen zu delegierten Berechtigungen und Anwendungsberechtigungen finden Sie unter Berechtigungstypen. Weitere Informationen zu diesen Berechtigungen finden Sie in der Berechtigungsreferenz.

Berechtigungstyp Berechtigungen mit den geringsten Berechtigungen Berechtigungen mit höheren Berechtigungen
Delegiert (Geschäfts-, Schul- oder Unikonto) AgentInstance.ReadWrite.All Nicht verfügbar.
Delegiert (persönliches Microsoft-Konto) Nicht unterstützt Nicht unterstützt
Application AgentInstance.ReadWrite.All AgentInstance.ReadWrite.ManagedBy

Wichtig

Bei Verwendung delegierter Berechtigungen muss dem authentifizierten Benutzer eine unterstützte Microsoft Entra Rolle oder eine benutzerdefinierte Rolle mit einer unterstützten Rollenberechtigung zugewiesen werden. Agent-Registrierungsadministrator ist die Rolle mit den geringsten Berechtigungen, die für diesen Vorgang unterstützt wird.

HTTP-Anforderung

POST /agentRegistry/agentInstances

Anforderungsheader

Name Beschreibung
Authorization Bearer {token}. Erforderlich. Erfahren Sie mehr über Authentifizierung und Autorisierung.
Content-Type application/json. Erforderlich.

Anforderungstext

Geben Sie im Anforderungstext eine JSON-Darstellung des agentInstance-Objekts an .

Sie können die folgenden Eigenschaften angeben, wenn Sie eine agentInstance erstellen.

Eigenschaft Typ Beschreibung
ownerIds String collection Liste der Besitzer-IDs für den Agent-instance. Erforderlich.
managedBy Zeichenfolge Anwendungsbezeichner, der diesen Agent verwaltet. Optional.
originatingStore Zeichenfolge Name des Speichers/Systems, aus dem/dem der Agent stammt. Optional.
displayName Zeichenfolge Anzeigename für den Agent-instance. Erforderlich.
sourceAgentId Zeichenfolge Ursprünglicher Agentbezeichner aus dem Quellsystem. Optional.
agentIdentityBlueprintId Zeichenfolge Agent-Identitäts-Blaupausenbezeichner. Optional.
agentIdentityId Zeichenfolge Identitätsbezeichner des Entra-Agents. Optional.
agentUserId Zeichenfolge Benutzer-ID, die dem Agent zugeordnet ist. Optional.
url Zeichenfolge Endpunkt-URL für den Agent-instance. Optional.
preferredTransport Zeichenfolge Bevorzugtes Transportprotokoll (JSONRPC, GRPC, HTTP+JSON). Optional.
additionalInterfaces agentInterface-Sammlung Zusätzliche Schnittstellen/Transporte, die vom Agent unterstützt werden (URL, Transport). Optional.
Signaturen agentCardSignature-Sammlung Digitale Signaturen für den Agent instance (geschützt, Signatur, Header). Optional.

Antwort

Bei erfolgreicher Ausführung gibt die Methode den 201 Created Antwortcode und ein agentInstance-Objekt im Antworttext zurück.

Beispiele

Beispiel 1: Erstellen einer agentInstance mit einem neuen agentCardManifest

Anforderung

Das folgende Beispiel zeigt eine Anfrage.

POST https://graph.microsoft.com/beta/agentRegistry/agentInstances
Content-Type: application/json

{
  "id": "Security Copilot Platform Agent: 00222",
  "ownerIds": [
    "daf58b0e-44e1-433c-b6b0-ca70cae320b8",
    "b9108c41-d2d2-4e78-b073-92f57b752bd0"
  ],
  "managedBy": "719cc904-9700-4e08-9941-fd826cc84c60",
  "originatingStore": "Microsoft Security Copilot",
  "createdBy": "d47bffae-411a-4de9-8548-05e79bc01f0d",
  "displayName": "Conditional Access Agent",
  "sourceAgentId": "00222",
  "agentIdentityBlueprintId": "d0108c41-d2d2-4e78-b073-92f57b752bd0",
  "agentIdentityId": "dd108c41-d2d2-4e78-b073-92f57b752bd0",
  "agentUserId": "ee108c41-d2d2-4e78-b073-92f57b752bd0",
  "createdDateTime": "2025-01-01T00:00:00.1234567Z",
  "lastModifiedDateTime": "2025-01-01T00:00:00.1234567Z",
  "url": "https://conditional-access-agent.example.com/a2a/v1",
  "preferredTransport": "JSONRPC",
  "additionalInterfaces": [
    {
      "url": "https://conditional-access-agent.example.com/a2a/v1",
      "transport": "JSONRPC"
    },
    {
      "url": "https://conditional-access-agent.example.com/a2a/grpc",
      "transport": "GRPC"
    },
    {
      "url": "https://conditional-access-agent.example.com/a2a/json",
      "transport": "HTTP+JSON"
    }
  ],
  "signatures": [
    {
      "protected": "eyJhbGciOiJFUzI1NiIsImtpZCI6ImRpZDp3ZWI6Y29udG9zby5leGFtcGxlI2tleS0xIiwidHlwIjoiYWdlbnRjYXJkK2p3cyJ9",
      "signature": "xOSim9oMw_CdZM-qDhmwpB5fJcBx5I30yh-FZULd1j9ruPEUBnJzmfCynNfH1KgmJ2B7ulAYc7D2iIb-4Ul-8w",
      "header": {
        "kidHint": "contoso-key-1",
        "nonce": "f1e9b6c3-2f3a-4a3a-b604-1f9af3f2a9c0"
      }
    }
  ],
  "agentCardManifest": {
    "ownerIds": [
      "0ef68a76-e247-41dd-947b-41282760a2ac"
    ],
    "originatingStore": "Copilot Studio",
    "displayName": "Conditional Access Agent Card",
    "description": "Manages organizational conditional access policies",
    "iconUrl": "https://example.com/icon.png",
    "provider": {
      "organization": "Test Organization",
      "url": "https://test.com"
    },
    "protocolVersion": "1.0",
    "version": "1.0.0",
    "documentationUrl": "https://example.com/docs",
    "capabilities": {
      "streaming": false,
      "pushNotifications": false,
      "stateTransitionHistory": true,
      "extensions": [
        {
          "uri": "https://contoso.example.com/a2a/capabilities/secureMessaging",
          "description": null,
          "required": false,
          "params": {
            "useHttps": true
          }
        }
      ]
    },
    "defaultInputModes": [
      "application/json"
    ],
    "defaultOutputModes": [
      "application/json",
      "text/html"
    ],
    "supportsAuthenticatedExtendedCard": true,
    "skills": [
      {
        "id": "threat-detection",
        "displayName": "Threat Detection",
        "description": "Detect security threats in real-time",
        "tags": [
          "security",
          "threat",
          "detection"
        ],
        "examples": [
          "Analyze this log for threats",
          "Check for malware"
        ],
        "inputModes": [
          "application/json",
          "text/plain"
        ],
        "outputModes": [
          "application/json",
          "text/html"
        ]
      }
    ]
  }
}

Antwort

Das folgende Beispiel zeigt die Antwort.

Hinweis: Das hier gezeigte Antwortobjekt kann zur besseren Lesbarkeit gekürzt werden.

HTTP/1.1 201 Created
Content-Type: application/json

{
  "id": "Security Copilot Platform Agent: 00222",
  "ownerIds": [
    "daf58b0e-44e1-433c-b6b0-ca70cae320b8",
    "b9108c41-d2d2-4e78-b073-92f57b752bd0"
  ],
  "managedBy": "719cc904-9700-4e08-9941-fd826cc84c60",
  "originatingStore": "Microsoft Security Copilot",
  "createdBy": "d47bffae-411a-4de9-8548-05e79bc01f0d",
  "displayName": "Conditional Access Agent",
  "sourceAgentId": "00222",
  "agentIdentityBlueprintId": "d0108c41-d2d2-4e78-b073-92f57b752bd0",
  "agentIdentityId": "dd108c41-d2d2-4e78-b073-92f57b752bd0",
  "agentUserId": "ee108c41-d2d2-4e78-b073-92f57b752bd0",
  "createdDateTime": "2025-01-01T00:00:00.1234567Z",
  "lastModifiedDateTime": "2025-01-01T00:00:00.1234567Z",
  "url": "https://conditional-access-agent.example.com/a2a/v1",
  "preferredTransport": "JSONRPC",
  "additionalInterfaces": [
    {
      "url": "https://conditional-access-agent.example.com/a2a/v1",
      "transport": "JSONRPC"
    },
    {
      "url": "https://conditional-access-agent.example.com/a2a/grpc",
      "transport": "GRPC"
    },
    {
      "url": "https://conditional-access-agent.example.com/a2a/json",
      "transport": "HTTP+JSON"
    }
  ],
  "signatures": [
    {
      "protected": "eyJhbGciOiJFUzI1NiIsImtpZCI6ImRpZDp3ZWI6Y29udG9zby5leGFtcGxlI2tleS0xIiwidHlwIjoiYWdlbnRjYXJkK2p3cyJ9",
      "signature": "xOSim9oMw_CdZM-qDhmwpB5fJcBx5I30yh-FZULd1j9ruPEUBnJzmfCynNfH1KgmJ2B7ulAYc7D2iIb-4Ul-8w",
      "header": {
        "kidHint": "contoso-key-1",
        "nonce": "f1e9b6c3-2f3a-4a3a-b604-1f9af3f2a9c0"
      }
    }
  ]
}

Beispiel 2: Erstellen einer agentInstance und Verweisen auf einen vorhandenen agentCardManifest

Anforderung

Das folgende Beispiel zeigt eine Anfrage.

POST https://graph.microsoft.com/beta/agentRegistry/agentInstances
Content-Type: application/json

{
  "id": "Security Copilot Platform Agent: 00222",
  "ownerIds": [
    "daf58b0e-44e1-433c-b6b0-ca70cae320b8",
    "b9108c41-d2d2-4e78-b073-92f57b752bd0"
  ],
  "managedBy": "719cc904-9700-4e08-9941-fd826cc84c60",
  "originatingStore": "Microsoft Security Copilot",
  "createdBy": "d47bffae-411a-4de9-8548-05e79bc01f0d",
  "displayName": "Conditional Access Agent",
  "sourceAgentId": "00222",
  "agentIdentityBlueprintId": "d0108c41-d2d2-4e78-b073-92f57b752bd0",
  "agentIdentityId": "dd108c41-d2d2-4e78-b073-92f57b752bd0",
  "agentUserId": "ee108c41-d2d2-4e78-b073-92f57b752bd0",
  "createdDateTime": "2025-01-01T00:00:00.1234567Z",
  "lastModifiedDateTime": "2025-01-01T00:00:00.1234567Z",
  "url": "https://conditional-access-agent.example.com/a2a/v1",
  "preferredTransport": "JSONRPC",
  "additionalInterfaces": [
    {
      "url": "https://conditional-access-agent.example.com/a2a/v1",
      "transport": "JSONRPC"
    },
    {
      "url": "https://conditional-access-agent.example.com/a2a/grpc",
      "transport": "GRPC"
    },
    {
      "url": "https://conditional-access-agent.example.com/a2a/json",
      "transport": "HTTP+JSON"
    }
  ],
  "signatures": [
    {
      "protected": "eyJhbGciOiJFUzI1NiIsImtpZCI6ImRpZDp3ZWI6Y29udG9zby5leGFtcGxlI2tleS0xIiwidHlwIjoiYWdlbnRjYXJkK2p3cyJ9",
      "signature": "xOSim9oMw_CdZM-qDhmwpB5fJcBx5I30yh-FZULd1j9ruPEUBnJzmfCynNfH1KgmJ2B7ulAYc7D2iIb-4Ul-8w",
      "header": {
        "kidHint": "contoso-key-1",
        "nonce": "f1e9b6c3-2f3a-4a3a-b604-1f9af3f2a9c0"
      }
    }
  ],
  "agentCardManifest@odata.bind": "https://graph.microsoft.com/beta/agentRegistry/agentCardManifests('employee-assistant')"
}

Antwort

Das folgende Beispiel zeigt die Antwort.

Hinweis: Das hier gezeigte Antwortobjekt kann zur besseren Lesbarkeit gekürzt werden.

HTTP/1.1 201 Created
Content-Type: application/json

{
  "id": "Security Copilot Platform Agent: 00222",
  "ownerIds": [
    "daf58b0e-44e1-433c-b6b0-ca70cae320b8",
    "b9108c41-d2d2-4e78-b073-92f57b752bd0"
  ],
  "managedBy": "719cc904-9700-4e08-9941-fd826cc84c60",
  "originatingStore": "Microsoft Security Copilot",
  "createdBy": "d47bffae-411a-4de9-8548-05e79bc01f0d",
  "displayName": "Conditional Access Agent",
  "sourceAgentId": "00222",
  "agentIdentityBlueprintId": "d0108c41-d2d2-4e78-b073-92f57b752bd0",
  "agentIdentityId": "dd108c41-d2d2-4e78-b073-92f57b752bd0",
  "agentUserId": "ee108c41-d2d2-4e78-b073-92f57b752bd0",
  "createdDateTime": "2025-01-01T00:00:00.1234567Z",
  "lastModifiedDateTime": "2025-01-01T00:00:00.1234567Z",
  "url": "https://conditional-access-agent.example.com/a2a/v1",
  "preferredTransport": "JSONRPC",
  "additionalInterfaces": [
    {
      "url": "https://conditional-access-agent.example.com/a2a/v1",
      "transport": "JSONRPC"
    },
    {
      "url": "https://conditional-access-agent.example.com/a2a/grpc",
      "transport": "GRPC"
    },
    {
      "url": "https://conditional-access-agent.example.com/a2a/json",
      "transport": "HTTP+JSON"
    }
  ],
  "signatures": [
    {
      "protected": "eyJhbGciOiJFUzI1NiIsImtpZCI6ImRpZDp3ZWI6Y29udG9zby5leGFtcGxlI2tleS0xIiwidHlwIjoiYWdlbnRjYXJkK2p3cyJ9",
      "signature": "xOSim9oMw_CdZM-qDhmwpB5fJcBx5I30yh-FZULd1j9ruPEUBnJzmfCynNfH1KgmJ2B7ulAYc7D2iIb-4Ul-8w",
      "header": {
        "kidHint": "contoso-key-1",
        "nonce": "f1e9b6c3-2f3a-4a3a-b604-1f9af3f2a9c0"
      }
    }
  ]
}

Beispiel 3: Erstellen einer agentInstance ohne agentCardManifest

Anforderung

Das folgende Beispiel zeigt eine Anfrage. Um später ein agentCardManifest hinzuzufügen, verwenden Sie die AgentInstance-API aktualisieren.

POST https://graph.microsoft.com/beta/agentRegistry/agentInstances
Content-Type: application/json

{
  "id": "Security Copilot Platform Agent: 00222",
  "ownerIds": [
    "daf58b0e-44e1-433c-b6b0-ca70cae320b8",
    "b9108c41-d2d2-4e78-b073-92f57b752bd0"
  ],
  "managedBy": "719cc904-9700-4e08-9941-fd826cc84c60",
  "originatingStore": "Microsoft Security Copilot",
  "createdBy": "d47bffae-411a-4de9-8548-05e79bc01f0d",
  "displayName": "Conditional Access Agent",
  "sourceAgentId": "00222",
  "agentIdentityBlueprintId": "d0108c41-d2d2-4e78-b073-92f57b752bd0",
  "agentIdentityId": "dd108c41-d2d2-4e78-b073-92f57b752bd0",
  "agentUserId": "ee108c41-d2d2-4e78-b073-92f57b752bd0",
  "createdDateTime": "2025-01-01T00:00:00.1234567Z",
  "lastModifiedDateTime": "2025-01-01T00:00:00.1234567Z",
  "url": "https://conditional-access-agent.example.com/a2a/v1",
  "preferredTransport": "JSONRPC",
  "additionalInterfaces": [
    {
      "url": "https://conditional-access-agent.example.com/a2a/v1",
      "transport": "JSONRPC"
    },
    {
      "url": "https://conditional-access-agent.example.com/a2a/grpc",
      "transport": "GRPC"
    },
    {
      "url": "https://conditional-access-agent.example.com/a2a/json",
      "transport": "HTTP+JSON"
    }
  ],
  "signatures": [
    {
      "protected": "eyJhbGciOiJFUzI1NiIsImtpZCI6ImRpZDp3ZWI6Y29udG9zby5leGFtcGxlI2tleS0xIiwidHlwIjoiYWdlbnRjYXJkK2p3cyJ9",
      "signature": "xOSim9oMw_CdZM-qDhmwpB5fJcBx5I30yh-FZULd1j9ruPEUBnJzmfCynNfH1KgmJ2B7ulAYc7D2iIb-4Ul-8w",
      "header": {
        "kidHint": "contoso-key-1",
        "nonce": "f1e9b6c3-2f3a-4a3a-b604-1f9af3f2a9c0"
      }
    }
  ]
}

Antwort

Das folgende Beispiel zeigt die Antwort.

Hinweis: Das hier gezeigte Antwortobjekt kann zur besseren Lesbarkeit gekürzt werden.

HTTP/1.1 201 Created
Content-Type: application/json

{
  "id": "Security Copilot Platform Agent: 00222",
  "ownerIds": [
    "daf58b0e-44e1-433c-b6b0-ca70cae320b8",
    "b9108c41-d2d2-4e78-b073-92f57b752bd0"
  ],
  "managedBy": "719cc904-9700-4e08-9941-fd826cc84c60",
  "originatingStore": "Microsoft Security Copilot",
  "createdBy": "d47bffae-411a-4de9-8548-05e79bc01f0d",
  "displayName": "Conditional Access Agent",
  "sourceAgentId": "00222",
  "agentIdentityBlueprintId": "d0108c41-d2d2-4e78-b073-92f57b752bd0",
  "agentIdentityId": "dd108c41-d2d2-4e78-b073-92f57b752bd0",
  "agentUserId": "ee108c41-d2d2-4e78-b073-92f57b752bd0",
  "createdDateTime": "2025-01-01T00:00:00.1234567Z",
  "lastModifiedDateTime": "2025-01-01T00:00:00.1234567Z",
  "url": "https://conditional-access-agent.example.com/a2a/v1",
  "preferredTransport": "JSONRPC",
  "additionalInterfaces": [
    {
      "url": "https://conditional-access-agent.example.com/a2a/v1",
      "transport": "JSONRPC"
    },
    {
      "url": "https://conditional-access-agent.example.com/a2a/grpc",
      "transport": "GRPC"
    },
    {
      "url": "https://conditional-access-agent.example.com/a2a/json",
      "transport": "HTTP+JSON"
    }
  ],
  "signatures": [
    {
      "protected": "eyJhbGciOiJFUzI1NiIsImtpZCI6ImRpZDp3ZWI6Y29udG9zby5leGFtcGxlI2tleS0xIiwidHlwIjoiYWdlbnRjYXJkK2p3cyJ9",
      "signature": "xOSim9oMw_CdZM-qDhmwpB5fJcBx5I30yh-FZULd1j9ruPEUBnJzmfCynNfH1KgmJ2B7ulAYc7D2iIb-4Ul-8w",
      "header": {
        "kidHint": "contoso-key-1",
        "nonce": "f1e9b6c3-2f3a-4a3a-b604-1f9af3f2a9c0"
      }
    }
  ]
}