MCPcopy Create free account
hub / github.com/Mnexa-AI/e2a / registerAgentProtection

Method registerAgentProtection

internal/httpapi/protection.go:123–143  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

121}
122
123func (s *Server) registerAgentProtection() {
124 huma.Register(s.API, huma.Operation{
125 OperationID: "getAgentProtection",
126 Method: http.MethodGet,
127 Path: "/v1/agents/{email}/protection",
128 Summary: "Get an agent's protection config (beta)",
129 Description: "Read the agent's protection posture — inbound/outbound trust gate, content-scan sensitivity, and hold-queue mechanism. Account scope only: an agent-scoped credential cannot read its own protection config. " + protectionBetaDoc,
130 Tags: []string{"agents"},
131 Security: []map[string][]string{{"bearer": {}}},
132 }, s.handleGetProtection)
133
134 huma.Register(s.API, huma.Operation{
135 OperationID: "putAgentProtection",
136 Method: http.MethodPut,
137 Path: "/v1/agents/{email}/protection",
138 Summary: "Replace an agent's protection config (beta)",
139 Description: "Replace the agent's protection posture wholesale. The three top-level keys (inbound, outbound, holds) are required; leaves default. Account scope only. " + protectionBetaDoc,
140 Tags: []string{"agents"},
141 Security: []map[string][]string{{"bearer": {}}},
142 }, s.handlePutProtection)
143}
144
145func (s *Server) handleGetProtection(ctx context.Context, in *getProtectionInput) (*protectionOutput, error) {
146 // Protection config is account administration — an agent-scoped credential

Callers 1

registerOperationsMethod · 0.95

Calls 1

RegisterMethod · 0.80

Tested by

no test coverage detected