symbi-runtime 1.7.0

Agent Runtime System for the Symbi platform
Documentation
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
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
openapi: 3.0.0
info:
  title: Symbiont Tool Review API
  description: AI-driven tool review and signing workflow API
  version: 1.0.0
  contact:
    name: Symbiont Platform Team
    email: api-support@symbiont.platform
  license:
    name: Apache-2.0
    url: https://www.apache.org/licenses/LICENSE-2.0

servers:
  - url: https://api.symbiont.platform/v1/tool-review
    description: Production server
  - url: https://staging-api.symbiont.platform/v1/tool-review
    description: Staging server

security:
  - BearerAuth: []

paths:
  /sessions:
    post:
      summary: Submit tool for review
      description: Submit an MCP tool for security analysis and review
      operationId: submitTool
      tags:
        - Review Sessions
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ToolSubmission'
      responses:
        '201':
          description: Tool submitted successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubmissionResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/RateLimited'

    get:
      summary: List review sessions
      description: Get a paginated list of review sessions
      operationId: listSessions
      tags:
        - Review Sessions
      parameters:
        - name: status
          in: query
          description: Filter by review status
          schema:
            type: string
            enum: [pending_review, under_review, awaiting_human_review, approved, rejected, signed, signing_failed]
        - name: page
          in: query
          description: Page number
          schema:
            type: integer
            minimum: 1
            default: 1
        - name: limit
          in: query
          description: Items per page
          schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 20
      responses:
        '200':
          description: List of review sessions
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SessionList'

  /sessions/{reviewId}:
    get:
      summary: Get review session details
      description: Get detailed information about a specific review session
      operationId: getSession
      tags:
        - Review Sessions
      parameters:
        - name: reviewId
          in: path
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: Review session details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReviewSession'
        '404':
          $ref: '#/components/responses/NotFound'

  /analysis/{analysisId}:
    get:
      summary: Get security analysis details
      description: Get detailed security analysis results
      operationId: getAnalysis
      tags:
        - Security Analysis
      parameters:
        - name: analysisId
          in: path
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: Security analysis details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SecurityAnalysis'

  /review/queue:
    get:
      summary: Get human review queue
      description: Get pending items requiring human review
      operationId: getReviewQueue
      tags:
        - Human Review
      responses:
        '200':
          description: Review queue items
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReviewQueue'

  /review/{reviewId}/decision:
    post:
      summary: Submit human review decision
      description: Submit approval or rejection decision for a tool
      operationId: submitDecision
      tags:
        - Human Review
      parameters:
        - name: reviewId
          in: path
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/HumanDecision'
      responses:
        '200':
          description: Decision submitted successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DecisionResponse'

  /signing/{reviewId}:
    get:
      summary: Get signing status
      description: Get the signing status and signature information
      operationId: getSigningStatus
      tags:
        - Tool Signing
      parameters:
        - name: reviewId
          in: path
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: Signing status
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SigningStatus'

  /signing/{reviewId}/download:
    get:
      summary: Download signed tool
      description: Download the signed tool with signature
      operationId: downloadSignedTool
      tags:
        - Tool Signing
      parameters:
        - name: reviewId
          in: path
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: Signed tool
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SignedTool'

  /stats:
    get:
      summary: Get workflow statistics
      description: Get overall workflow statistics and metrics
      operationId: getStats
      tags:
        - Statistics
      responses:
        '200':
          description: Workflow statistics
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkflowStats'

components:
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

  schemas:
    ToolSubmission:
      type: object
      required:
        - tool
        - submitted_by
      properties:
        tool:
          $ref: '#/components/schemas/McpTool'
        submitted_by:
          type: string
          format: email
        priority:
          type: string
          enum: [low, normal, high, urgent]
          default: normal

    McpTool:
      type: object
      required:
        - name
        - description
        - schema
        - provider
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 100
        description:
          type: string
          minLength: 1
          maxLength: 500
        schema:
          type: object
        provider:
          $ref: '#/components/schemas/ToolProvider'

    ToolProvider:
      type: object
      required:
        - name
        - public_key_url
      properties:
        name:
          type: string
        public_key_url:
          type: string
          format: uri

    SubmissionResponse:
      type: object
      properties:
        review_id:
          type: string
          format: uuid
        status:
          type: string
          enum: [pending_review]
        submitted_at:
          type: string
          format: date-time
        estimated_completion:
          type: string
          format: date-time

    ReviewSession:
      type: object
      properties:
        review_id:
          type: string
          format: uuid
        tool:
          $ref: '#/components/schemas/McpTool'
        state:
          $ref: '#/components/schemas/ReviewState'
        security_analysis:
          $ref: '#/components/schemas/SecurityAnalysisSummary'
        audit_trail:
          type: array
          items:
            $ref: '#/components/schemas/AuditEvent'
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time

    ReviewState:
      oneOf:
        - $ref: '#/components/schemas/PendingReviewState'
        - $ref: '#/components/schemas/UnderReviewState'
        - $ref: '#/components/schemas/AwaitingHumanReviewState'
        - $ref: '#/components/schemas/ApprovedState'
        - $ref: '#/components/schemas/RejectedState'
        - $ref: '#/components/schemas/SignedState'

    PendingReviewState:
      type: object
      properties:
        type:
          type: string
          enum: [pending_review]
        submitted_at:
          type: string
          format: date-time
        submitted_by:
          type: string

    UnderReviewState:
      type: object
      properties:
        type:
          type: string
          enum: [under_review]
        started_at:
          type: string
          format: date-time
        analyzer_id:
          type: string
        analysis_id:
          type: string
          format: uuid

    AwaitingHumanReviewState:
      type: object
      properties:
        type:
          type: string
          enum: [awaiting_human_review]
        analysis_id:
          type: string
          format: uuid
        analysis_completed_at:
          type: string
          format: date-time
        critical_findings:
          type: array
          items:
            $ref: '#/components/schemas/SecurityFinding'
        risk_score:
          type: number
          minimum: 0
          maximum: 1
        ai_recommendation:
          $ref: '#/components/schemas/ReviewRecommendation'

    ApprovedState:
      type: object
      properties:
        type:
          type: string
          enum: [approved]
        approved_by:
          type: string
        approved_at:
          type: string
          format: date-time
        approval_notes:
          type: string

    RejectedState:
      type: object
      properties:
        type:
          type: string
          enum: [rejected]
        rejected_by:
          type: string
        rejected_at:
          type: string
          format: date-time
        rejection_reason:
          type: string

    SignedState:
      type: object
      properties:
        type:
          type: string
          enum: [signed]
        signature_info:
          $ref: '#/components/schemas/SignatureInfo'
        signed_at:
          type: string
          format: date-time
        signed_by:
          type: string

    SecurityFinding:
      type: object
      properties:
        finding_id:
          type: string
        severity:
          type: string
          enum: [low, medium, high, critical]
        category:
          type: string
          enum: [schema_injection, privilege_escalation, data_exfiltration, malicious_code, suspicious_parameters, unvalidated_input, insecure_defaults, other]
        title:
          type: string
        description:
          type: string
        location:
          type: string
        confidence:
          type: number
          minimum: 0
          maximum: 1
        remediation_suggestion:
          type: string
        cve_references:
          type: array
          items:
            type: string

    ReviewRecommendation:
      oneOf:
        - type: object
          properties:
            type:
              type: string
              enum: [approve]
            confidence:
              type: number
            reasoning:
              type: string
        - type: object
          properties:
            type:
              type: string
              enum: [reject]
            confidence:
              type: number
            reasoning:
              type: string
        - type: object
          properties:
            type:
              type: string
              enum: [requires_human_judgment]
            reasoning:
              type: string

    SecurityAnalysis:
      type: object
      properties:
        analysis_id:
          type: string
          format: uuid
        tool_id:
          type: string
        analyzed_at:
          type: string
          format: date-time
        analyzer_version:
          type: string
        risk_score:
          type: number
          minimum: 0
          maximum: 1
        findings:
          type: array
          items:
            $ref: '#/components/schemas/SecurityFinding'
        recommendations:
          type: array
          items:
            type: string
        confidence_score:
          type: number
          minimum: 0
          maximum: 1
        analysis_metadata:
          $ref: '#/components/schemas/AnalysisMetadata'

    SecurityAnalysisSummary:
      type: object
      properties:
        analysis_id:
          type: string
          format: uuid
        risk_score:
          type: number
        confidence_score:
          type: number
        findings_count:
          type: integer
        processing_time_ms:
          type: integer

    AnalysisMetadata:
      type: object
      properties:
        processing_time_ms:
          type: integer
        rag_queries_performed:
          type: integer
        knowledge_sources_consulted:
          type: array
          items:
            type: string
        patterns_matched:
          type: array
          items:
            type: string
        false_positive_likelihood:
          type: number

    HumanDecision:
      type: object
      required:
        - decision
        - reasoning
        - operator_id
      properties:
        decision:
          type: string
          enum: [approve, reject, request_reanalysis, escalate_to_senior]
        reasoning:
          type: string
          minLength: 10
        operator_id:
          type: string
        time_spent_seconds:
          type: integer
          minimum: 0
        additional_notes:
          type: string

    DecisionResponse:
      type: object
      properties:
        decision_id:
          type: string
        review_id:
          type: string
          format: uuid
        status:
          type: string
        next_action:
          type: string
        decided_at:
          type: string
          format: date-time

    SigningStatus:
      type: object
      properties:
        review_id:
          type: string
          format: uuid
        signing_status:
          type: string
          enum: [pending, in_progress, completed, failed]
        signature_info:
          $ref: '#/components/schemas/SignatureInfo'
        signed_schema:
          type: object

    SignatureInfo:
      type: object
      properties:
        signature:
          type: string
        algorithm:
          type: string
        public_key_url:
          type: string
          format: uri
        signed_at:
          type: string
          format: date-time
        expires_at:
          type: string
          format: date-time

    SignedTool:
      type: object
      properties:
        tool:
          allOf:
            - $ref: '#/components/schemas/McpTool'
            - type: object
              properties:
                verification_status:
                  type: string
                  enum: [signed]
                signature_info:
                  $ref: '#/components/schemas/SignatureInfo'

    SessionList:
      type: object
      properties:
        sessions:
          type: array
          items:
            $ref: '#/components/schemas/SessionSummary'
        pagination:
          $ref: '#/components/schemas/Pagination'

    SessionSummary:
      type: object
      properties:
        review_id:
          type: string
          format: uuid
        tool_name:
          type: string
        status:
          type: string
        risk_score:
          type: number
        submitted_at:
          type: string
          format: date-time
        submitted_by:
          type: string

    ReviewQueue:
      type: object
      properties:
        pending_reviews:
          type: array
          items:
            $ref: '#/components/schemas/QueueItem'
        queue_stats:
          $ref: '#/components/schemas/QueueStats'

    QueueItem:
      type: object
      properties:
        review_id:
          type: string
          format: uuid
        tool_name:
          type: string
        provider:
          type: string
        risk_score:
          type: number
        critical_findings_count:
          type: integer
        high_findings_count:
          type: integer
        ai_recommendation:
          type: string
        priority_score:
          type: number
        submitted_at:
          type: string
          format: date-time
        time_in_queue:
          type: string
          format: duration

    QueueStats:
      type: object
      properties:
        total_pending:
          type: integer
        high_priority:
          type: integer
        avg_wait_time:
          type: string
          format: duration

    WorkflowStats:
      type: object
      properties:
        overall:
          $ref: '#/components/schemas/OverallStats'
        current_queue:
          $ref: '#/components/schemas/CurrentQueueStats'
        top_security_categories:
          type: array
          items:
            $ref: '#/components/schemas/CategoryCount'
        time_period:
          $ref: '#/components/schemas/TimePeriod'

    OverallStats:
      type: object
      properties:
        total_reviews:
          type: integer
        approved_tools:
          type: integer
        rejected_tools:
          type: integer
        signed_tools:
          type: integer
        avg_analysis_time_ms:
          type: integer
        avg_human_review_time_ms:
          type: integer
        auto_approval_rate:
          type: number
        false_positive_rate:
          type: number

    CurrentQueueStats:
      type: object
      properties:
        pending_analysis:
          type: integer
        awaiting_human_review:
          type: integer
        pending_signing:
          type: integer

    CategoryCount:
      type: object
      properties:
        category:
          type: string
        count:
          type: integer

    TimePeriod:
      type: object
      properties:
        start:
          type: string
          format: date-time
        end:
          type: string
          format: date-time

    Pagination:
      type: object
      properties:
        page:
          type: integer
        limit:
          type: integer
        total:
          type: integer
        total_pages:
          type: integer

    AuditEvent:
      type: object
      properties:
        event_type:
          type: string
        timestamp:
          type: string
          format: date-time
        actor:
          type: string
        details:
          type: object

    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
            message:
              type: string
            details:
              type: object
            request_id:
              type: string
            timestamp:
              type: string
              format: date-time

  responses:
    BadRequest:
      description: Bad request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'

    Unauthorized:
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'

    Forbidden:
      description: Forbidden
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'

    NotFound:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'

    RateLimited:
      description: Rate limit exceeded
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
      headers:
        X-RateLimit-Limit:
          schema:
            type: integer
        X-RateLimit-Remaining:
          schema:
            type: integer
        X-RateLimit-Reset:
          schema:
            type: integer

tags:
  - name: Review Sessions
    description: Tool review session management
  - name: Security Analysis
    description: Security analysis operations
  - name: Human Review
    description: Human review workflow
  - name: Tool Signing
    description: Tool signing operations
  - name: Statistics
    description: Workflow statistics and monitoring