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

Function TestScreenOutbound_GateAction

internal/agent/screening_test.go:61–81  ·  view source on GitHub ↗

TestScreenOutbound_GateAction: a flagged recipient escalates to the agent's outbound_policy_action; open/allow produces ActionAllow.

(t *testing.T)

Source from the content-addressed store, hash-verified

59// TestScreenOutbound_GateAction: a flagged recipient escalates to the agent's
60// outbound_policy_action; open/allow produces ActionAllow.
61func TestScreenOutbound_GateAction(t *testing.T) {
62 a := testScreenAPI()
63 req := outbound.SendRequest{To: []string{"x@elsewhere.com"}, Subject: "hi", Body: "hello"}
64 for _, action := range []string{"flag", "review", "block"} {
65 ag := &identity.AgentIdentity{
66 Domain: "bot.example.com", ID: "bot@bot.example.com",
67 OutboundPolicy: identity.OutboundPolicyDomain, OutboundPolicyAction: action,
68 OutboundScan: identity.ScanOff,
69 }
70 v := a.screenOutbound(context.Background(), ag, req)
71 if string(v.Applied) != action {
72 t.Errorf("action=%s: applied=%q, want %q", action, v.Applied, action)
73 }
74 if v.ReviewReason != identity.ReviewReasonRecipientGate {
75 t.Errorf("action=%s: reason=%q, want recipient_gate", action, v.ReviewReason)
76 }
77 if v.GateAddr != "x@elsewhere.com" {
78 t.Errorf("action=%s: gate addr=%q", action, v.GateAddr)
79 }
80 }
81}
82
83func TestScreenOutbound_OpenAllowsBenign(t *testing.T) {
84 a := testScreenAPI()

Callers

nothing calls this directly

Calls 2

testScreenAPIFunction · 0.85
screenOutboundMethod · 0.80

Tested by

no test coverage detected