tandem-server 0.6.9

HTTP server for Tandem engine APIs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
use super::*;

#[cfg(feature = "premium-governance")]
use crate::automation_v2::governance::{
    GovernanceActorRef, GovernanceApprovalRequest, GovernanceApprovalRequestType,
    GovernanceApprovalStatus,
};
use tandem_enterprise_contract::{
    EnterprisePolicyEffect, EnterprisePolicyRule, EnterprisePolicyScopeLevel,
};
use tandem_types::{
    approval_authorizes_execution, DataClass, GateRequest, PolicyDecisionEffect,
    ReviewerEligibility, ToolRiskTier,
};

fn tenant() -> TenantContext {
    TenantContext::explicit("acme", "acme", None)
}

#[tokio::test]
async fn external_customer_send_pauses_for_approval_and_records_evidence() {
    let state = test_state().await;
    let tenant = tenant();

    let (outcome, decision_id) = state
        .enforce_action_gate(
            &tenant,
            &GateRequest::external_customer_send(),
            Some("mcp.email.send".to_string()),
            Some("agent-sales".to_string()),
            1_000,
        )
        .await;

    assert!(
        outcome.requires_approval(),
        "external send must pause for approval"
    );
    let decision_id = decision_id.expect("gate decision must be recorded");

    // Policy decision evidence.
    let decisions = state.list_policy_decisions(&tenant, 50).await;
    let recorded = decisions
        .iter()
        .find(|d| d.decision_id == decision_id)
        .expect("recorded policy decision");
    assert_eq!(recorded.decision, PolicyDecisionEffect::ApprovalRequired);
    assert_eq!(recorded.policy_id.as_deref(), Some("approval_gate_matrix"));
    assert_eq!(recorded.risk_tier.as_deref(), Some("external_send"));

    // Protected audit evidence.
    let audit = tokio::fs::read_to_string(&state.protected_audit_path)
        .await
        .expect("protected audit file");
    assert!(audit.contains("\"event_type\":\"approval.gate.approval_required\""));
    assert!(audit.contains("\"org_id\":\"acme\""));
    assert!(audit.contains("agent-sales"));
}

#[tokio::test]
async fn sensitive_data_class_requires_elevated_reviewer_in_metadata() {
    let state = test_state().await;
    let tenant = tenant();

    let (outcome, decision_id) = state
        .enforce_action_gate(
            &tenant,
            &GateRequest::new(
                Some(ToolRiskTier::InternalWrite),
                Some(DataClass::FinancialRecord),
            ),
            Some("mcp.ledger.read".to_string()),
            Some("agent-fin".to_string()),
            1_000,
        )
        .await;

    assert!(outcome.requires_approval());
    assert_eq!(
        outcome.reviewer_eligibility,
        ReviewerEligibility::ElevatedReviewer
    );

    let decision_id = decision_id.expect("decision recorded");
    let decisions = state.list_policy_decisions(&tenant, 50).await;
    let recorded = decisions
        .iter()
        .find(|d| d.decision_id == decision_id)
        .expect("recorded policy decision");
    assert_eq!(
        recorded.metadata["gate"]["reviewer_eligibility"],
        "elevated_reviewer"
    );
    assert!(recorded.data_classes.contains(&DataClass::FinancialRecord));
}

#[tokio::test]
async fn low_risk_action_auto_allows_without_audit() {
    let state = test_state().await;
    let tenant = tenant();

    let (outcome, decision_id) = state
        .enforce_action_gate(
            &tenant,
            &GateRequest::new(Some(ToolRiskTier::ReadDiscover), Some(DataClass::Internal)),
            Some("mcp.search".to_string()),
            Some("agent-x".to_string()),
            1_000,
        )
        .await;

    assert!(outcome.is_allowed());
    assert!(decision_id.is_some(), "allow decisions are still recorded");

    // No protected audit event is written for an auto-allow.
    let audit = tokio::fs::read_to_string(&state.protected_audit_path)
        .await
        .unwrap_or_default();
    assert!(!audit.contains("approval.gate"));
}

#[tokio::test]
async fn enterprise_policy_override_blocks_locally_allowed_action_gate() {
    let state = test_state().await;
    let tenant = tenant();
    state.enterprise.policy_rules.write().await.insert(
        "enterprise-bank-tool-deny".to_string(),
        EnterprisePolicyRule::new(
            "enterprise-bank-tool-deny",
            "enterprise-bank-floor",
            EnterprisePolicyScopeLevel::Enterprise,
            EnterprisePolicyEffect::Deny,
        )
        .with_tenant_context(tenant.clone())
        .with_tool_patterns(vec!["mcp.bank.*".to_string()])
        .with_reason(
            "enterprise_bank_tool_floor",
            "enterprise policy denies bank tool access",
        ),
    );

    let (outcome, decision_id) = state
        .enforce_action_gate(
            &tenant,
            &GateRequest::new(Some(ToolRiskTier::ReadDiscover), Some(DataClass::Internal)),
            Some("mcp.bank.release_funds".to_string()),
            Some("agent-fin".to_string()),
            1_000,
        )
        .await;

    assert!(outcome.is_denied());
    assert_eq!(outcome.reason_code, "enterprise_bank_tool_floor");
    let decision_id = decision_id.expect("decision recorded");
    let decisions = state.list_policy_decisions(&tenant, 50).await;
    let recorded = decisions
        .iter()
        .find(|d| d.decision_id == decision_id)
        .expect("recorded policy decision");
    assert_eq!(recorded.decision, PolicyDecisionEffect::Deny);
    assert_eq!(recorded.reason_code, "enterprise_bank_tool_floor");

    let audit = tokio::fs::read_to_string(&state.protected_audit_path)
        .await
        .expect("protected audit file");
    assert!(audit.contains("\"event_type\":\"approval.gate.denied\""));
    assert!(audit.contains("enterprise_bank_tool_floor"));
}

#[tokio::test]
async fn unclassified_action_fails_closed_to_approval() {
    let state = test_state().await;
    let tenant = tenant();

    let (outcome, _) = state
        .enforce_action_gate(&tenant, &GateRequest::new(None, None), None, None, 1_000)
        .await;

    assert!(
        outcome.requires_approval(),
        "unknown action must not auto-allow"
    );
    assert_eq!(
        outcome.reviewer_eligibility,
        ReviewerEligibility::ElevatedReviewer
    );
    assert_eq!(outcome.reason_code, "unresolved_policy_fail_closed");
}

#[tokio::test]
async fn expired_approval_cannot_authorize_execution() {
    // An approval whose TTL has elapsed cannot authorize execution even though
    // it was approved.
    let expires_at = 5_000;
    assert!(approval_authorizes_execution(true, expires_at, 4_999));
    assert!(!approval_authorizes_execution(true, expires_at, 5_000));
    assert!(!approval_authorizes_execution(false, expires_at, 4_000));
}

#[tokio::test]
async fn tool_policy_gate_pauses_high_risk_tool_and_skips_reads() {
    use tandem_core::ToolPolicyContext;

    let state = test_state().await;
    let ctx = |tool: &str| ToolPolicyContext {
        session_id: "session-gate".to_string(),
        message_id: "message-gate".to_string(),
        tenant_context: Some(tenant()),
        verified_tenant_context: None,
        tool: tool.to_string(),
        args: json!({}),
    };

    // A customer-facing send classifies as ExternalSend and is paused.
    let send = crate::agent_teams::evaluate_action_gate_tool_policy(
        &state,
        &ctx("mcp.email.send"),
        "mcp.email.send",
    )
    .await
    .expect("high-risk tool must be gated");
    assert!(!send.allowed, "external send must be paused for approval");
    assert!(
        send.policy_decision_id.is_some(),
        "gate records a policy decision"
    );

    // The gate left protected audit evidence.
    let audit = tokio::fs::read_to_string(&state.protected_audit_path)
        .await
        .expect("protected audit file");
    assert!(audit.contains("\"event_type\":\"approval.gate.approval_required\""));

    // A read/discovery tool is not gated here.
    let read = crate::agent_teams::evaluate_action_gate_tool_policy(
        &state,
        &ctx("mcp.search"),
        "mcp.search",
    )
    .await;
    assert!(read.is_none(), "low-risk read tools fall through the gate");
}

#[cfg(feature = "premium-governance")]
fn protected_action_context() -> tandem_core::ToolPolicyContext {
    tandem_core::ToolPolicyContext {
        session_id: "session-action-approval".to_string(),
        message_id: "message-action-approval".to_string(),
        tenant_context: Some(tenant()),
        verified_tenant_context: None,
        tool: "mcp.email.send".to_string(),
        args: json!({
            "to": "ops@example.com",
            "subject": "status",
            "body": "Deployment finished."
        }),
    }
}

#[cfg(feature = "premium-governance")]
async fn evaluate_protected_action(state: &AppState) -> tandem_core::ToolPolicyDecision {
    let ctx = protected_action_context();
    crate::agent_teams::evaluate_action_gate_tool_policy(state, &ctx, &ctx.tool)
        .await
        .expect("external send must resolve through the action gate")
}

#[cfg(feature = "premium-governance")]
async fn action_gate_approval(state: &AppState) -> GovernanceApprovalRequest {
    state
        .list_approval_requests_for_tenant(
            Some(GovernanceApprovalRequestType::ElevatedCapability),
            None,
            &tenant(),
        )
        .await
        .into_iter()
        .next()
        .expect("durable action-gate approval request")
}

#[cfg(feature = "premium-governance")]
#[tokio::test]
async fn action_gate_pending_retry_reuses_durable_request() {
    let state = test_state().await;

    let first = evaluate_protected_action(&state).await;
    let second = evaluate_protected_action(&state).await;
    assert!(!first.allowed);
    assert!(!second.allowed);

    let approvals = state
        .list_approval_requests_for_tenant(
            Some(GovernanceApprovalRequestType::ElevatedCapability),
            None,
            &tenant(),
        )
        .await;
    assert_eq!(approvals.len(), 1, "pending retries must deduplicate");
    let approval = &approvals[0];
    assert_eq!(approval.status, GovernanceApprovalStatus::Pending);
    assert_eq!(
        approval
            .context
            .pointer("/action_gate/session_id")
            .and_then(Value::as_str),
        Some("session-action-approval")
    );
    assert_eq!(
        approval
            .context
            .pointer("/action_gate/message_id")
            .and_then(Value::as_str),
        Some("message-action-approval")
    );
    assert_eq!(
        approval
            .context
            .pointer("/action_gate/tool")
            .and_then(Value::as_str),
        Some("mcp.email.send")
    );
    assert_eq!(
        approval
            .context
            .pointer("/action_gate/risk_tier")
            .and_then(Value::as_str),
        Some("external_send")
    );
    assert_eq!(
        approval
            .context
            .pointer("/action_gate/policy_id")
            .and_then(Value::as_str),
        Some("approval_gate_matrix")
    );
    assert!(approval
        .context
        .pointer("/action_gate/action_hash")
        .and_then(Value::as_str)
        .is_some());

    for decision in [first, second] {
        let decision_id = decision.policy_decision_id.expect("policy decision id");
        let recorded = state
            .get_policy_decision(&decision_id)
            .await
            .expect("linked policy decision");
        assert_eq!(
            recorded.approval_id.as_deref(),
            Some(approval.approval_id.as_str())
        );
        assert_eq!(
            recorded.session_id.as_deref(),
            Some("session-action-approval")
        );
        assert_eq!(
            recorded.message_id.as_deref(),
            Some("message-action-approval")
        );
    }
}

#[cfg(feature = "premium-governance")]
#[tokio::test]
async fn action_gate_new_message_gets_a_distinct_approval() {
    let state = test_state().await;
    assert!(!evaluate_protected_action(&state).await.allowed);

    let mut next = protected_action_context();
    next.message_id = "message-action-approval-next".to_string();
    let decision = crate::agent_teams::evaluate_action_gate_tool_policy(&state, &next, &next.tool)
        .await
        .expect("new message remains approval gated");
    assert!(!decision.allowed);

    let approvals = state
        .list_approval_requests_for_tenant(
            Some(GovernanceApprovalRequestType::ElevatedCapability),
            None,
            &tenant(),
        )
        .await;
    assert_eq!(
        approvals.len(),
        2,
        "new messages must not reuse old receipts"
    );
}

#[cfg(feature = "premium-governance")]
#[tokio::test]
async fn action_gate_denial_executes_zero_times() {
    let state = test_state().await;
    assert!(!evaluate_protected_action(&state).await.allowed);
    let approval = action_gate_approval(&state).await;
    state
        .decide_approval_request(
            &approval.approval_id,
            GovernanceActorRef::human(Some("reviewer-1".to_string()), "test"),
            false,
            Some("denied in test".to_string()),
            &tenant(),
        )
        .await
        .expect("deny approval")
        .expect("approval exists");

    let executions = usize::from(evaluate_protected_action(&state).await.allowed);
    assert_eq!(executions, 0, "denied action must never dispatch");
}

#[cfg(feature = "premium-governance")]
#[tokio::test]
async fn action_gate_approval_resumes_exactly_one_execution() {
    let state = test_state().await;
    assert!(!evaluate_protected_action(&state).await.allowed);
    let approval = action_gate_approval(&state).await;
    state
        .decide_approval_request(
            &approval.approval_id,
            GovernanceActorRef::human(Some("reviewer-1".to_string()), "test"),
            true,
            Some("approved in test".to_string()),
            &tenant(),
        )
        .await
        .expect("approve request")
        .expect("approval exists");

    let first_retry = evaluate_protected_action(&state).await;
    let second_retry = evaluate_protected_action(&state).await;
    let executions = usize::from(first_retry.allowed) + usize::from(second_retry.allowed);
    assert_eq!(executions, 1, "approved action must dispatch exactly once");

    let consumed = state
        .get_governance_approval_request(&approval.approval_id)
        .await
        .expect("consumed approval remains durable");
    assert!(consumed
        .context
        .pointer("/action_gate/consumed_at_ms")
        .and_then(Value::as_u64)
        .is_some());
}

#[tokio::test]
async fn egress_preflight_blocks_secret_content_before_external_send() {
    use tandem_core::ToolPolicyContext;

    let state = test_state().await;
    let ctx = ToolPolicyContext {
        session_id: "session-egress-secret".to_string(),
        message_id: "message-egress-secret".to_string(),
        tenant_context: Some(tenant()),
        verified_tenant_context: None,
        tool: "mcp.email.send".to_string(),
        args: json!({
            "to": "customer@example.com",
            "subject": "credential leak",
            "body": "use API key sk-test-secret for the integration"
        }),
    };

    let decision =
        crate::agent_teams::evaluate_egress_preflight_tool_policy(&state, &ctx, "mcp.email.send")
            .await
            .expect("secret-bearing external send must be blocked");
    assert!(!decision.allowed);
    let decision_id = decision.policy_decision_id.expect("policy decision id");

    let recorded = state
        .get_policy_decision(&decision_id)
        .await
        .expect("recorded policy decision");
    assert_eq!(recorded.decision, PolicyDecisionEffect::Deny);
    assert_eq!(recorded.policy_id.as_deref(), Some("egress_dlp_preflight"));
    assert!(recorded.data_classes.contains(&DataClass::Credential));
    assert!(recorded.approval_id.is_none());
    let preview = recorded.metadata["egress_preflight"]["safe_preview_markdown"]
        .as_str()
        .expect("safe preview");
    assert!(preview.contains("[redacted credential]"));
    assert!(!preview.contains("sk-test-secret"));

    let audit = tokio::fs::read_to_string(&state.protected_audit_path)
        .await
        .expect("protected audit file");
    assert!(audit.contains("\"event_type\":\"egress.preflight.denied\""));
    assert!(audit.contains(&decision_id));
}

#[tokio::test]
async fn egress_preflight_blocks_truncated_array_payloads_fail_closed() {
    use tandem_core::ToolPolicyContext;

    let state = test_state().await;
    let rows = (0..25)
        .map(|idx| {
            json!({
                "row": idx,
                "message": format!("benign outbound row {idx}")
            })
        })
        .collect::<Vec<_>>();
    let ctx = ToolPolicyContext {
        session_id: "session-egress-truncated".to_string(),
        message_id: "message-egress-truncated".to_string(),
        tenant_context: Some(tenant()),
        verified_tenant_context: None,
        tool: "mcp.email.send".to_string(),
        args: json!({
            "to": "ops@example.com",
            "rows": rows
        }),
    };

    let decision =
        crate::agent_teams::evaluate_egress_preflight_tool_policy(&state, &ctx, "mcp.email.send")
            .await
            .expect("truncated external payload inspection must fail closed");
    assert!(!decision.allowed);
    let decision_id = decision.policy_decision_id.expect("policy decision id");

    let recorded = state
        .get_policy_decision(&decision_id)
        .await
        .expect("recorded policy decision");
    assert_eq!(recorded.decision, PolicyDecisionEffect::Deny);
    assert_eq!(recorded.reason_code, "egress_payload_inspection_truncated");
    assert_eq!(
        recorded
            .metadata
            .pointer("/egress_preflight/inspection_truncated")
            .and_then(Value::as_bool),
        Some(true)
    );

    let audit = tokio::fs::read_to_string(&state.protected_audit_path)
        .await
        .expect("protected audit file");
    assert!(audit.contains("\"inspection_truncated\":true"));
    assert!(audit.contains(&decision_id));
}

#[tokio::test]
async fn egress_preflight_creates_safe_customer_data_approval_request() {
    use tandem_core::ToolPolicyContext;

    let state = test_state().await;
    if !state.premium_governance_enabled() {
        return;
    }

    let ctx = ToolPolicyContext {
        session_id: "session-egress-customer".to_string(),
        message_id: "message-egress-customer".to_string(),
        tenant_context: Some(tenant()),
        verified_tenant_context: None,
        tool: "mcp.email.send".to_string(),
        args: json!({
            "to": "alice.customer@example.com",
            "subject": "Renewal follow-up",
            "body": "Hi Alice, your account ACME-42 renewal is ready."
        }),
    };

    let decision =
        crate::agent_teams::evaluate_egress_preflight_tool_policy(&state, &ctx, "mcp.email.send")
            .await
            .expect("customer-data external send must require approval");
    assert!(!decision.allowed);
    let decision_id = decision.policy_decision_id.expect("policy decision id");

    let recorded = state
        .get_policy_decision(&decision_id)
        .await
        .expect("recorded policy decision");
    assert_eq!(recorded.decision, PolicyDecisionEffect::ApprovalRequired);
    let approval_id = recorded.approval_id.clone().expect("approval id");
    assert!(recorded.data_classes.contains(&DataClass::CustomerData));
    let preview = recorded.metadata["egress_preflight"]["safe_preview_markdown"]
        .as_str()
        .expect("safe preview");
    assert!(preview.contains("a***@example.com"));
    assert!(!preview.contains("alice.customer@example.com"));

    let approvals = state
        .list_approval_requests_for_tenant(None, None, &tenant())
        .await;
    let approval = approvals
        .iter()
        .find(|approval| approval.approval_id == approval_id)
        .expect("pending approval request");
    assert_eq!(
        approval.request_type,
        crate::automation_v2::governance::GovernanceApprovalRequestType::ExternalPost
    );
    assert_eq!(
        approval.context["safe_preview_markdown"].as_str(),
        Some(preview)
    );

    let audit = tokio::fs::read_to_string(&state.protected_audit_path)
        .await
        .expect("protected audit file");
    assert!(audit.contains("\"event_type\":\"egress.preflight.approval_required\""));
    assert!(audit.contains(&decision_id));
    assert!(audit.contains(&approval_id));
}

#[tokio::test]
async fn egress_preflight_redacts_webhook_target_before_approval_audit() {
    use tandem_core::ToolPolicyContext;

    let state = test_state().await;
    if !state.premium_governance_enabled() {
        return;
    }
    let secret_webhook =
        "https://hooks.example.com/services/T000/B000/super-secret-token?sig=hidden";
    let ctx = ToolPolicyContext {
        session_id: "session-egress-webhook".to_string(),
        message_id: "message-egress-webhook".to_string(),
        tenant_context: Some(tenant()),
        verified_tenant_context: None,
        tool: "mcp.webhook.post".to_string(),
        args: json!({
            "webhook_url": secret_webhook,
            "body": "Customer alice.customer@example.com renewal amount is ready."
        }),
    };

    let decision =
        crate::agent_teams::evaluate_egress_preflight_tool_policy(&state, &ctx, "mcp.webhook.post")
            .await
            .expect("customer-data webhook post must require approval");
    assert!(!decision.allowed);
    let decision_id = decision.policy_decision_id.expect("policy decision id");
    let recorded = state
        .get_policy_decision(&decision_id)
        .await
        .expect("recorded policy decision");
    assert_eq!(recorded.decision, PolicyDecisionEffect::ApprovalRequired);
    let target = recorded.metadata["egress_preflight"]["target"]
        .as_str()
        .expect("redacted target");
    assert!(target.contains("https://hooks.example.com/[redacted-url-target]#"));
    assert!(!target.contains("super-secret-token"));
    assert!(!target.contains("sig=hidden"));

    let approval_id = recorded.approval_id.clone().expect("approval id");
    let approvals = state
        .list_approval_requests_for_tenant(None, None, &tenant())
        .await;
    let approval = approvals
        .iter()
        .find(|approval| approval.approval_id == approval_id)
        .expect("pending approval request");
    assert_eq!(approval.context["target"].as_str(), Some(target));
    assert!(!approval.context.to_string().contains("super-secret-token"));
    assert!(!approval.context.to_string().contains("sig=hidden"));

    let audit = tokio::fs::read_to_string(&state.protected_audit_path)
        .await
        .expect("protected audit file");
    assert!(audit.contains(target));
    assert!(!audit.contains("super-secret-token"));
    assert!(!audit.contains("sig=hidden"));
}