agentkernel 0.2.9__tar.gz → 0.2.11__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (97) hide show
  1. {agentkernel-0.2.9 → agentkernel-0.2.11}/PKG-INFO +198 -7
  2. {agentkernel-0.2.9 → agentkernel-0.2.11}/README.md +189 -0
  3. {agentkernel-0.2.9 → agentkernel-0.2.11}/pyproject.toml +12 -10
  4. {agentkernel-0.2.9 → agentkernel-0.2.11}/src/agentkernel/api/a2a/a2a.py +4 -5
  5. {agentkernel-0.2.9 → agentkernel-0.2.11}/src/agentkernel/api/handler.py +28 -18
  6. {agentkernel-0.2.9 → agentkernel-0.2.11}/src/agentkernel/api/mcp/akmcp.py +3 -2
  7. {agentkernel-0.2.9 → agentkernel-0.2.11}/src/agentkernel/core/__init__.py +2 -2
  8. {agentkernel-0.2.9 → agentkernel-0.2.11}/src/agentkernel/core/base.py +41 -2
  9. {agentkernel-0.2.9 → agentkernel-0.2.11}/src/agentkernel/core/config.py +19 -9
  10. {agentkernel-0.2.9 → agentkernel-0.2.11}/src/agentkernel/core/hooks.py +11 -10
  11. {agentkernel-0.2.9 → agentkernel-0.2.11}/src/agentkernel/core/module.py +35 -4
  12. agentkernel-0.2.11/src/agentkernel/core/runtime.py +234 -0
  13. {agentkernel-0.2.9 → agentkernel-0.2.11}/src/agentkernel/core/service.py +4 -7
  14. {agentkernel-0.2.9 → agentkernel-0.2.11}/src/agentkernel/core/session/base.py +1 -1
  15. {agentkernel-0.2.9 → agentkernel-0.2.11}/src/agentkernel/deployment/aws/aklambda.py +1 -3
  16. {agentkernel-0.2.9 → agentkernel-0.2.11}/src/agentkernel/framework/adk/adk.py +33 -13
  17. {agentkernel-0.2.9 → agentkernel-0.2.11}/src/agentkernel/framework/crewai/crewai.py +32 -8
  18. {agentkernel-0.2.9 → agentkernel-0.2.11}/src/agentkernel/framework/langgraph/langgraph.py +25 -4
  19. {agentkernel-0.2.9 → agentkernel-0.2.11}/src/agentkernel/framework/openai/openai.py +34 -13
  20. agentkernel-0.2.11/src/agentkernel/guardrail/bedrock.py +294 -0
  21. agentkernel-0.2.11/src/agentkernel/guardrail/guardrail.py +92 -0
  22. agentkernel-0.2.11/src/agentkernel/guardrail/openai.py +213 -0
  23. {agentkernel-0.2.9 → agentkernel-0.2.11}/src/agentkernel/integration/gmail/gmail_chat.py +7 -21
  24. {agentkernel-0.2.9 → agentkernel-0.2.11}/src/agentkernel/integration/slack/README.md +11 -2
  25. agentkernel-0.2.11/src/agentkernel/integration/slack/slack_chat.py +301 -0
  26. {agentkernel-0.2.9 → agentkernel-0.2.11}/src/agentkernel/integration/telegram/telegram_chat.py +1 -3
  27. {agentkernel-0.2.9 → agentkernel-0.2.11}/src/agentkernel/integration/whatsapp/README.md +13 -2
  28. {agentkernel-0.2.9 → agentkernel-0.2.11}/src/agentkernel/integration/whatsapp/whatsapp_chat.py +180 -17
  29. {agentkernel-0.2.9 → agentkernel-0.2.11}/src/agentkernel/test/test.py +3 -9
  30. {agentkernel-0.2.9 → agentkernel-0.2.11}/src/agentkernel/trace/langfuse/langgraph.py +2 -6
  31. agentkernel-0.2.11/src/agentkernel/trace/openllmetry/__init__.py +0 -0
  32. agentkernel-0.2.9/src/agentkernel/core/runtime.py +0 -308
  33. agentkernel-0.2.9/src/agentkernel/integration/slack/slack_chat.py +0 -160
  34. {agentkernel-0.2.9 → agentkernel-0.2.11}/src/agentkernel/__init__.py +0 -0
  35. {agentkernel-0.2.9 → agentkernel-0.2.11}/src/agentkernel/adk.py +0 -0
  36. {agentkernel-0.2.9 → agentkernel-0.2.11}/src/agentkernel/api/__init__.py +0 -0
  37. {agentkernel-0.2.9 → agentkernel-0.2.11}/src/agentkernel/api/a2a/__init__.py +0 -0
  38. {agentkernel-0.2.9 → agentkernel-0.2.11}/src/agentkernel/api/a2a/handler.py +0 -0
  39. {agentkernel-0.2.9 → agentkernel-0.2.11}/src/agentkernel/api/http.py +0 -0
  40. {agentkernel-0.2.9 → agentkernel-0.2.11}/src/agentkernel/api/mcp/__init__.py +0 -0
  41. {agentkernel-0.2.9 → agentkernel-0.2.11}/src/agentkernel/aws.py +0 -0
  42. {agentkernel-0.2.9 → agentkernel-0.2.11}/src/agentkernel/cli/__init__.py +0 -0
  43. {agentkernel-0.2.9 → agentkernel-0.2.11}/src/agentkernel/cli/cli.py +0 -0
  44. {agentkernel-0.2.9 → agentkernel-0.2.11}/src/agentkernel/core/builder.py +0 -0
  45. {agentkernel-0.2.9 → agentkernel-0.2.11}/src/agentkernel/core/model.py +0 -0
  46. {agentkernel-0.2.9 → agentkernel-0.2.11}/src/agentkernel/core/session/__init__.py +0 -0
  47. {agentkernel-0.2.9 → agentkernel-0.2.11}/src/agentkernel/core/session/dynamodb.py +0 -0
  48. {agentkernel-0.2.9 → agentkernel-0.2.11}/src/agentkernel/core/session/in_memory.py +0 -0
  49. {agentkernel-0.2.9 → agentkernel-0.2.11}/src/agentkernel/core/session/redis.py +0 -0
  50. {agentkernel-0.2.9 → agentkernel-0.2.11}/src/agentkernel/core/session/serde.py +0 -0
  51. {agentkernel-0.2.9 → agentkernel-0.2.11}/src/agentkernel/core/util/config_yaml_util.py +0 -0
  52. {agentkernel-0.2.9 → agentkernel-0.2.11}/src/agentkernel/core/util/key_value_cache.py +0 -0
  53. {agentkernel-0.2.9 → agentkernel-0.2.11}/src/agentkernel/crewai.py +0 -0
  54. {agentkernel-0.2.9 → agentkernel-0.2.11}/src/agentkernel/deployment/__init__.py +0 -0
  55. {agentkernel-0.2.9 → agentkernel-0.2.11}/src/agentkernel/deployment/aws/__init__.py +0 -0
  56. {agentkernel-0.2.9 → agentkernel-0.2.11}/src/agentkernel/framework/__init__.py +0 -0
  57. {agentkernel-0.2.9 → agentkernel-0.2.11}/src/agentkernel/framework/adk/__init__.py +0 -0
  58. {agentkernel-0.2.9 → agentkernel-0.2.11}/src/agentkernel/framework/crewai/__init__.py +0 -0
  59. {agentkernel-0.2.9 → agentkernel-0.2.11}/src/agentkernel/framework/langgraph/__init__.py +0 -0
  60. {agentkernel-0.2.9 → agentkernel-0.2.11}/src/agentkernel/framework/openai/__init__.py +0 -0
  61. {agentkernel-0.2.9 → agentkernel-0.2.11}/src/agentkernel/gmail.py +0 -0
  62. {agentkernel-0.2.9/src/agentkernel/trace/langfuse → agentkernel-0.2.11/src/agentkernel/guardrail}/__init__.py +0 -0
  63. {agentkernel-0.2.9 → agentkernel-0.2.11}/src/agentkernel/instagram.py +0 -0
  64. {agentkernel-0.2.9 → agentkernel-0.2.11}/src/agentkernel/integration/__init__.py +0 -0
  65. {agentkernel-0.2.9 → agentkernel-0.2.11}/src/agentkernel/integration/gmail/README.md +0 -0
  66. {agentkernel-0.2.9 → agentkernel-0.2.11}/src/agentkernel/integration/gmail/__init__.py +0 -0
  67. {agentkernel-0.2.9 → agentkernel-0.2.11}/src/agentkernel/integration/instagram/README.md +0 -0
  68. {agentkernel-0.2.9 → agentkernel-0.2.11}/src/agentkernel/integration/instagram/__init__.py +0 -0
  69. {agentkernel-0.2.9 → agentkernel-0.2.11}/src/agentkernel/integration/instagram/instagram_chat.py +0 -0
  70. {agentkernel-0.2.9 → agentkernel-0.2.11}/src/agentkernel/integration/messenger/README.md +0 -0
  71. {agentkernel-0.2.9 → agentkernel-0.2.11}/src/agentkernel/integration/messenger/__init__.py +0 -0
  72. {agentkernel-0.2.9 → agentkernel-0.2.11}/src/agentkernel/integration/messenger/messenger_chat.py +0 -0
  73. {agentkernel-0.2.9 → agentkernel-0.2.11}/src/agentkernel/integration/slack/__init__.py +0 -0
  74. {agentkernel-0.2.9 → agentkernel-0.2.11}/src/agentkernel/integration/telegram/README.md +0 -0
  75. {agentkernel-0.2.9 → agentkernel-0.2.11}/src/agentkernel/integration/telegram/__init__.py +0 -0
  76. {agentkernel-0.2.9 → agentkernel-0.2.11}/src/agentkernel/integration/whatsapp/__init__.py +0 -0
  77. {agentkernel-0.2.9 → agentkernel-0.2.11}/src/agentkernel/langgraph.py +0 -0
  78. {agentkernel-0.2.9 → agentkernel-0.2.11}/src/agentkernel/mcp.py +0 -0
  79. {agentkernel-0.2.9 → agentkernel-0.2.11}/src/agentkernel/messenger.py +0 -0
  80. {agentkernel-0.2.9 → agentkernel-0.2.11}/src/agentkernel/openai.py +0 -0
  81. {agentkernel-0.2.9 → agentkernel-0.2.11}/src/agentkernel/slack.py +0 -0
  82. {agentkernel-0.2.9 → agentkernel-0.2.11}/src/agentkernel/telegram.py +0 -0
  83. {agentkernel-0.2.9 → agentkernel-0.2.11}/src/agentkernel/test/__init__.py +0 -0
  84. {agentkernel-0.2.9 → agentkernel-0.2.11}/src/agentkernel/trace/__init__.py +0 -0
  85. {agentkernel-0.2.9 → agentkernel-0.2.11}/src/agentkernel/trace/base.py +0 -0
  86. {agentkernel-0.2.9/src/agentkernel/trace/openllmetry → agentkernel-0.2.11/src/agentkernel/trace/langfuse}/__init__.py +0 -0
  87. {agentkernel-0.2.9 → agentkernel-0.2.11}/src/agentkernel/trace/langfuse/adk.py +0 -0
  88. {agentkernel-0.2.9 → agentkernel-0.2.11}/src/agentkernel/trace/langfuse/crewai.py +0 -0
  89. {agentkernel-0.2.9 → agentkernel-0.2.11}/src/agentkernel/trace/langfuse/langfuse.py +0 -0
  90. {agentkernel-0.2.9 → agentkernel-0.2.11}/src/agentkernel/trace/langfuse/openai.py +0 -0
  91. {agentkernel-0.2.9 → agentkernel-0.2.11}/src/agentkernel/trace/openllmetry/adk.py +0 -0
  92. {agentkernel-0.2.9 → agentkernel-0.2.11}/src/agentkernel/trace/openllmetry/crewai.py +0 -0
  93. {agentkernel-0.2.9 → agentkernel-0.2.11}/src/agentkernel/trace/openllmetry/langgraph.py +0 -0
  94. {agentkernel-0.2.9 → agentkernel-0.2.11}/src/agentkernel/trace/openllmetry/openai.py +0 -0
  95. {agentkernel-0.2.9 → agentkernel-0.2.11}/src/agentkernel/trace/openllmetry/openllmetry.py +0 -0
  96. {agentkernel-0.2.9 → agentkernel-0.2.11}/src/agentkernel/trace/trace.py +0 -0
  97. {agentkernel-0.2.9 → agentkernel-0.2.11}/src/agentkernel/whatsapp.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: agentkernel
3
- Version: 0.2.9
3
+ Version: 0.2.11
4
4
  Summary: Agent Kernel - Unified AI Agents Runtime
5
5
  Author: Yaala Labs
6
6
  Author-email: Yaala Labs <agentkernel@yaalalabs.com>
@@ -28,17 +28,19 @@ Requires-Dist: google-api-python-client>=2.0.0 ; extra == 'gmail'
28
28
  Requires-Dist: httpx>=0.27.0 ; extra == 'instagram'
29
29
  Requires-Dist: langfuse>=3.9.2 ; extra == 'langfuse'
30
30
  Requires-Dist: nest-asyncio>=1.6.0 ; extra == 'langfuse'
31
- Requires-Dist: langgraph~=0.6.2 ; extra == 'langgraph'
32
- Requires-Dist: langchain~=0.3.27 ; extra == 'langgraph'
33
- Requires-Dist: langchain-community~=0.3.27 ; extra == 'langgraph'
34
- Requires-Dist: litellm~=1.74.3 ; extra == 'langgraph'
31
+ Requires-Dist: langgraph~=1.0.5 ; extra == 'langgraph'
32
+ Requires-Dist: langchain~=1.2.3 ; extra == 'langgraph'
33
+ Requires-Dist: langchain-community~=0.4.1 ; extra == 'langgraph'
34
+ Requires-Dist: litellm~=1.74.9 ; extra == 'langgraph'
35
35
  Requires-Dist: fastmcp>=2.12.4 ; extra == 'mcp'
36
36
  Requires-Dist: httpx>=0.27.0 ; extra == 'messenger'
37
- Requires-Dist: openai-agents>=0.6.3 ; extra == 'openai'
37
+ Requires-Dist: openai-agents>=0.6.5 ; extra == 'openai'
38
38
  Requires-Dist: openinference-instrumentation-openai-agents>=1.4.0 ; extra == 'openai'
39
+ Requires-Dist: openai-guardrails>=0.2.1 ; extra == 'openai'
39
40
  Requires-Dist: traceloop-sdk>=0.48.0 ; extra == 'openllmetry'
40
41
  Requires-Dist: redis>=7.1.0 ; extra == 'redis'
41
42
  Requires-Dist: slack-bolt==1.22.0 ; extra == 'slack'
43
+ Requires-Dist: httpx>=0.27.0 ; extra == 'slack'
42
44
  Requires-Dist: httpx>=0.27.0 ; extra == 'telegram'
43
45
  Requires-Dist: pytest>=8.4.1 ; extra == 'test'
44
46
  Requires-Dist: pytest-asyncio>=1.2.0 ; extra == 'test'
@@ -51,7 +53,7 @@ Requires-Dist: datasets>=2.14.0 ; extra == 'test'
51
53
  Requires-Dist: pandas>=2.0.0 ; extra == 'test'
52
54
  Requires-Dist: litellm>=1.74.9 ; extra == 'test'
53
55
  Requires-Dist: httpx>=0.27.0 ; extra == 'whatsapp'
54
- Requires-Python: >=3.12
56
+ Requires-Python: >=3.12, <3.14
55
57
  Provides-Extra: a2a
56
58
  Provides-Extra: adk
57
59
  Provides-Extra: api
@@ -515,6 +517,138 @@ test:
515
517
  embedding_model: text-embedding-3-small
516
518
  ```
517
519
 
520
+ #### Guardrails Configuration
521
+
522
+ Configure input and output guardrails to validate agent requests and responses for safety and compliance.
523
+
524
+ - **Input Guardrails**
525
+ - **Enabled**
526
+ - **Field**: `guardrail.input.enabled`
527
+ - **Default**: `false`
528
+ - **Description**: Enable input validation guardrails
529
+ - **Environment Variable**: `AK_GUARDRAIL__INPUT__ENABLED`
530
+
531
+ - **Type**
532
+ - **Field**: `guardrail.input.type`
533
+ - **Default**: `openai`
534
+ - **Options**: `openai`, `bedrock`
535
+ - **Description**: Guardrail provider type
536
+ - **Environment Variable**: `AK_GUARDRAIL__INPUT__TYPE`
537
+
538
+ - **Config Path**
539
+ - **Field**: `guardrail.input.config_path`
540
+ - **Default**: `None`
541
+ - **Description**: Path to guardrail configuration JSON file (OpenAI only)
542
+ - **Environment Variable**: `AK_GUARDRAIL__INPUT__CONFIG_PATH`
543
+
544
+ - **Model**
545
+ - **Field**: `guardrail.input.model`
546
+ - **Default**: `gpt-4o-mini`
547
+ - **Description**: LLM model to use for guardrail validation (OpenAI only)
548
+ - **Environment Variable**: `AK_GUARDRAIL__INPUT__MODEL`
549
+
550
+ - **ID**
551
+ - **Field**: `guardrail.input.id`
552
+ - **Default**: `None`
553
+ - **Description**: AWS Bedrock guardrail ID (Bedrock only)
554
+ - **Environment Variable**: `AK_GUARDRAIL__INPUT__ID`
555
+
556
+ - **Version**
557
+ - **Field**: `guardrail.input.version`
558
+ - **Default**: `DRAFT`
559
+ - **Description**: AWS Bedrock guardrail version (Bedrock only)
560
+ - **Environment Variable**: `AK_GUARDRAIL__INPUT__VERSION`
561
+
562
+ - **Output Guardrails**
563
+ - **Enabled**
564
+ - **Field**: `guardrail.output.enabled`
565
+ - **Default**: `false`
566
+ - **Description**: Enable output validation guardrails
567
+ - **Environment Variable**: `AK_GUARDRAIL__OUTPUT__ENABLED`
568
+
569
+ - **Type**
570
+ - **Field**: `guardrail.output.type`
571
+ - **Default**: `openai`
572
+ - **Options**: `openai`, `bedrock`
573
+ - **Description**: Guardrail provider type
574
+ - **Environment Variable**: `AK_GUARDRAIL__OUTPUT__TYPE`
575
+
576
+ - **Config Path**
577
+ - **Field**: `guardrail.output.config_path`
578
+ - **Default**: `None`
579
+ - **Description**: Path to guardrail configuration JSON file (OpenAI only)
580
+ - **Environment Variable**: `AK_GUARDRAIL__OUTPUT__CONFIG_PATH`
581
+
582
+ - **Model**
583
+ - **Field**: `guardrail.output.model`
584
+ - **Default**: `gpt-4o-mini`
585
+ - **Description**: LLM model to use for guardrail validation (OpenAI only)
586
+ - **Environment Variable**: `AK_GUARDRAIL__OUTPUT__MODEL`
587
+
588
+ - **ID**
589
+ - **Field**: `guardrail.output.id`
590
+ - **Default**: `None`
591
+ - **Description**: AWS Bedrock guardrail ID (Bedrock only)
592
+ - **Environment Variable**: `AK_GUARDRAIL__OUTPUT__ID`
593
+
594
+ - **Version**
595
+ - **Field**: `guardrail.output.version`
596
+ - **Default**: `DRAFT`
597
+ - **Description**: AWS Bedrock guardrail version (Bedrock only)
598
+ - **Environment Variable**: `AK_GUARDRAIL__OUTPUT__VERSION`
599
+
600
+ **Guardrail Setup:**
601
+
602
+ To use OpenAI guardrails, install the openai-guardrails package:
603
+
604
+ ```bash
605
+ pip install agentkernel[openai]
606
+ ```
607
+
608
+ To use AWS Bedrock guardrails, install the AWS package:
609
+
610
+ ```bash
611
+ pip install agentkernel[aws]
612
+ ```
613
+
614
+ Create guardrail configuration:
615
+
616
+ **For OpenAI:** Create configuration files following the [OpenAI Guardrails format](https://guardrails.openai.com/).
617
+
618
+ **For Bedrock:** Create a guardrail in AWS Bedrock and note the guardrail ID and version.
619
+
620
+ Configure guardrails in your configuration:
621
+
622
+ **OpenAI Example:**
623
+ ```yaml
624
+ guardrail:
625
+ input:
626
+ enabled: true
627
+ type: openai
628
+ model: gpt-4o-mini
629
+ config_path: /path/to/guardrails_input.json
630
+ output:
631
+ enabled: true
632
+ type: openai
633
+ model: gpt-4o-mini
634
+ config_path: /path/to/guardrails_output.json
635
+ ```
636
+
637
+ **Bedrock Example:**
638
+ ```yaml
639
+ guardrail:
640
+ input:
641
+ enabled: true
642
+ type: bedrock
643
+ id: your-guardrail-id
644
+ version: "1" # or "DRAFT"
645
+ output:
646
+ enabled: true
647
+ type: bedrock
648
+ id: your-guardrail-id
649
+ version: "1"
650
+ ```
651
+
518
652
  #### Messaging Platform Integrations
519
653
 
520
654
  Configure integrations with messaging platforms.
@@ -577,6 +711,17 @@ Configure integrations with messaging platforms.
577
711
  - **Bot Token**, **Webhook Secret**, **API Version**
578
712
  - **Environment Variables**: `AK_TELEGRAM__BOT_TOKEN`, `AK_TELEGRAM__WEBHOOK_SECRET`, `AK_TELEGRAM__API_VERSION`
579
713
 
714
+ ##### Gmail
715
+
716
+ - **Agent**
717
+ - **Field**: `gmail.agent`
718
+ - **Default**: `"general"`
719
+ - **Description**: Default agent for Gmail interactions
720
+ - **Environment Variable**: `AK_GMAIL__AGENT`
721
+
722
+ - **Client ID**, **Client Secret**, **Token File**, **Poll Interval**, **Label Filter**
723
+ - **Environment Variables**: `AK_GMAIL__CLIENT_ID`, `AK_GMAIL__CLIENT_SECRET`, `AK_GMAIL__TOKEN_FILE`, `AK_GMAIL__POLL_INTERVAL`, `AK_GMAIL__LABEL_FILTER`
724
+
580
725
  ### Configuration Examples
581
726
 
582
727
  #### Environment Variables
@@ -605,12 +750,24 @@ export AK_TEST__MODE=fallback # Options: fuzzy, judge, fallback
605
750
  export AK_TEST__JUDGE__MODEL=gpt-4o-mini
606
751
  export AK_TEST__JUDGE__PROVIDER=openai
607
752
  export AK_TEST__JUDGE__EMBEDDING_MODEL=text-embedding-3-small
753
+ # Guardrails configuration
754
+ export AK_GUARDRAIL__INPUT__ENABLED=false
755
+ export AK_GUARDRAIL__INPUT__TYPE=openai
756
+ export AK_GUARDRAIL__INPUT__MODEL=gpt-4o-mini
757
+ export AK_GUARDRAIL__INPUT__CONFIG_PATH=/path/to/guardrails_input.json
758
+ export AK_GUARDRAIL__OUTPUT__ENABLED=false
759
+ export AK_GUARDRAIL__OUTPUT__TYPE=openai
760
+ export AK_GUARDRAIL__OUTPUT__MODEL=gpt-4o-mini
761
+ export AK_GUARDRAIL__OUTPUT__CONFIG_PATH=/path/to/guardrails_output.json
608
762
  # Messaging platforms (optional)
609
763
  export AK_SLACK__AGENT=my-agent
610
764
  export AK_WHATSAPP__AGENT=my-agent
611
765
  export AK_MESSENGER__AGENT=my-agent
612
766
  export AK_INSTAGRAM__AGENT=my-agent
613
767
  export AK_TELEGRAM__AGENT=my-agent
768
+ export AK_GMAIL__AGENT=my-agent
769
+ export AK_GMAIL__CLIENT_ID=your-google-client-id
770
+ export AK_GMAIL__CLIENT_SECRET=your-google-client-secret
614
771
  ```
615
772
 
616
773
  #### .env File
@@ -671,6 +828,17 @@ test:
671
828
  model: gpt-4o-mini
672
829
  provider: openai
673
830
  embedding_model: text-embedding-3-small
831
+ guardrail:
832
+ input:
833
+ enabled: false
834
+ type: openai
835
+ model: gpt-4o-mini
836
+ config_path: /path/to/guardrails_input.json
837
+ output:
838
+ enabled: false
839
+ type: openai
840
+ model: gpt-4o-mini
841
+ config_path: /path/to/guardrails_output.json
674
842
  slack:
675
843
  agent: my-agent
676
844
  agent_acknowledgement: "Processing your request..."
@@ -683,6 +851,10 @@ instagram:
683
851
  agent: my-agent
684
852
  telegram:
685
853
  agent: my-agent
854
+ gmail:
855
+ agent: my-agent
856
+ poll_interval: 30
857
+ label_filter: "INBOX"
686
858
  ```
687
859
 
688
860
  #### config.json
@@ -729,6 +901,20 @@ telegram:
729
901
  "embedding_model": "text-embedding-3-small"
730
902
  }
731
903
  },
904
+ "guardrail": {
905
+ "input": {
906
+ "enabled": false,
907
+ "type": "openai",
908
+ "model": "gpt-4o-mini",
909
+ "config_path": "/path/to/guardrails_input.json"
910
+ },
911
+ "output": {
912
+ "enabled": false,
913
+ "type": "openai",
914
+ "model": "gpt-4o-mini",
915
+ "config_path": "/path/to/guardrails_output.json"
916
+ }
917
+ },
732
918
  "slack": {
733
919
  "agent": "my-agent",
734
920
  "agent_acknowledgement": "Processing your request..."
@@ -745,6 +931,11 @@ telegram:
745
931
  },
746
932
  "telegram": {
747
933
  "agent": "my-agent"
934
+ },
935
+ "gmail": {
936
+ "agent": "my-agent",
937
+ "poll_interval": 30,
938
+ "label_filter": "INBOX"
748
939
  }
749
940
  }
750
941
  ```
@@ -440,6 +440,138 @@ test:
440
440
  embedding_model: text-embedding-3-small
441
441
  ```
442
442
 
443
+ #### Guardrails Configuration
444
+
445
+ Configure input and output guardrails to validate agent requests and responses for safety and compliance.
446
+
447
+ - **Input Guardrails**
448
+ - **Enabled**
449
+ - **Field**: `guardrail.input.enabled`
450
+ - **Default**: `false`
451
+ - **Description**: Enable input validation guardrails
452
+ - **Environment Variable**: `AK_GUARDRAIL__INPUT__ENABLED`
453
+
454
+ - **Type**
455
+ - **Field**: `guardrail.input.type`
456
+ - **Default**: `openai`
457
+ - **Options**: `openai`, `bedrock`
458
+ - **Description**: Guardrail provider type
459
+ - **Environment Variable**: `AK_GUARDRAIL__INPUT__TYPE`
460
+
461
+ - **Config Path**
462
+ - **Field**: `guardrail.input.config_path`
463
+ - **Default**: `None`
464
+ - **Description**: Path to guardrail configuration JSON file (OpenAI only)
465
+ - **Environment Variable**: `AK_GUARDRAIL__INPUT__CONFIG_PATH`
466
+
467
+ - **Model**
468
+ - **Field**: `guardrail.input.model`
469
+ - **Default**: `gpt-4o-mini`
470
+ - **Description**: LLM model to use for guardrail validation (OpenAI only)
471
+ - **Environment Variable**: `AK_GUARDRAIL__INPUT__MODEL`
472
+
473
+ - **ID**
474
+ - **Field**: `guardrail.input.id`
475
+ - **Default**: `None`
476
+ - **Description**: AWS Bedrock guardrail ID (Bedrock only)
477
+ - **Environment Variable**: `AK_GUARDRAIL__INPUT__ID`
478
+
479
+ - **Version**
480
+ - **Field**: `guardrail.input.version`
481
+ - **Default**: `DRAFT`
482
+ - **Description**: AWS Bedrock guardrail version (Bedrock only)
483
+ - **Environment Variable**: `AK_GUARDRAIL__INPUT__VERSION`
484
+
485
+ - **Output Guardrails**
486
+ - **Enabled**
487
+ - **Field**: `guardrail.output.enabled`
488
+ - **Default**: `false`
489
+ - **Description**: Enable output validation guardrails
490
+ - **Environment Variable**: `AK_GUARDRAIL__OUTPUT__ENABLED`
491
+
492
+ - **Type**
493
+ - **Field**: `guardrail.output.type`
494
+ - **Default**: `openai`
495
+ - **Options**: `openai`, `bedrock`
496
+ - **Description**: Guardrail provider type
497
+ - **Environment Variable**: `AK_GUARDRAIL__OUTPUT__TYPE`
498
+
499
+ - **Config Path**
500
+ - **Field**: `guardrail.output.config_path`
501
+ - **Default**: `None`
502
+ - **Description**: Path to guardrail configuration JSON file (OpenAI only)
503
+ - **Environment Variable**: `AK_GUARDRAIL__OUTPUT__CONFIG_PATH`
504
+
505
+ - **Model**
506
+ - **Field**: `guardrail.output.model`
507
+ - **Default**: `gpt-4o-mini`
508
+ - **Description**: LLM model to use for guardrail validation (OpenAI only)
509
+ - **Environment Variable**: `AK_GUARDRAIL__OUTPUT__MODEL`
510
+
511
+ - **ID**
512
+ - **Field**: `guardrail.output.id`
513
+ - **Default**: `None`
514
+ - **Description**: AWS Bedrock guardrail ID (Bedrock only)
515
+ - **Environment Variable**: `AK_GUARDRAIL__OUTPUT__ID`
516
+
517
+ - **Version**
518
+ - **Field**: `guardrail.output.version`
519
+ - **Default**: `DRAFT`
520
+ - **Description**: AWS Bedrock guardrail version (Bedrock only)
521
+ - **Environment Variable**: `AK_GUARDRAIL__OUTPUT__VERSION`
522
+
523
+ **Guardrail Setup:**
524
+
525
+ To use OpenAI guardrails, install the openai-guardrails package:
526
+
527
+ ```bash
528
+ pip install agentkernel[openai]
529
+ ```
530
+
531
+ To use AWS Bedrock guardrails, install the AWS package:
532
+
533
+ ```bash
534
+ pip install agentkernel[aws]
535
+ ```
536
+
537
+ Create guardrail configuration:
538
+
539
+ **For OpenAI:** Create configuration files following the [OpenAI Guardrails format](https://guardrails.openai.com/).
540
+
541
+ **For Bedrock:** Create a guardrail in AWS Bedrock and note the guardrail ID and version.
542
+
543
+ Configure guardrails in your configuration:
544
+
545
+ **OpenAI Example:**
546
+ ```yaml
547
+ guardrail:
548
+ input:
549
+ enabled: true
550
+ type: openai
551
+ model: gpt-4o-mini
552
+ config_path: /path/to/guardrails_input.json
553
+ output:
554
+ enabled: true
555
+ type: openai
556
+ model: gpt-4o-mini
557
+ config_path: /path/to/guardrails_output.json
558
+ ```
559
+
560
+ **Bedrock Example:**
561
+ ```yaml
562
+ guardrail:
563
+ input:
564
+ enabled: true
565
+ type: bedrock
566
+ id: your-guardrail-id
567
+ version: "1" # or "DRAFT"
568
+ output:
569
+ enabled: true
570
+ type: bedrock
571
+ id: your-guardrail-id
572
+ version: "1"
573
+ ```
574
+
443
575
  #### Messaging Platform Integrations
444
576
 
445
577
  Configure integrations with messaging platforms.
@@ -502,6 +634,17 @@ Configure integrations with messaging platforms.
502
634
  - **Bot Token**, **Webhook Secret**, **API Version**
503
635
  - **Environment Variables**: `AK_TELEGRAM__BOT_TOKEN`, `AK_TELEGRAM__WEBHOOK_SECRET`, `AK_TELEGRAM__API_VERSION`
504
636
 
637
+ ##### Gmail
638
+
639
+ - **Agent**
640
+ - **Field**: `gmail.agent`
641
+ - **Default**: `"general"`
642
+ - **Description**: Default agent for Gmail interactions
643
+ - **Environment Variable**: `AK_GMAIL__AGENT`
644
+
645
+ - **Client ID**, **Client Secret**, **Token File**, **Poll Interval**, **Label Filter**
646
+ - **Environment Variables**: `AK_GMAIL__CLIENT_ID`, `AK_GMAIL__CLIENT_SECRET`, `AK_GMAIL__TOKEN_FILE`, `AK_GMAIL__POLL_INTERVAL`, `AK_GMAIL__LABEL_FILTER`
647
+
505
648
  ### Configuration Examples
506
649
 
507
650
  #### Environment Variables
@@ -530,12 +673,24 @@ export AK_TEST__MODE=fallback # Options: fuzzy, judge, fallback
530
673
  export AK_TEST__JUDGE__MODEL=gpt-4o-mini
531
674
  export AK_TEST__JUDGE__PROVIDER=openai
532
675
  export AK_TEST__JUDGE__EMBEDDING_MODEL=text-embedding-3-small
676
+ # Guardrails configuration
677
+ export AK_GUARDRAIL__INPUT__ENABLED=false
678
+ export AK_GUARDRAIL__INPUT__TYPE=openai
679
+ export AK_GUARDRAIL__INPUT__MODEL=gpt-4o-mini
680
+ export AK_GUARDRAIL__INPUT__CONFIG_PATH=/path/to/guardrails_input.json
681
+ export AK_GUARDRAIL__OUTPUT__ENABLED=false
682
+ export AK_GUARDRAIL__OUTPUT__TYPE=openai
683
+ export AK_GUARDRAIL__OUTPUT__MODEL=gpt-4o-mini
684
+ export AK_GUARDRAIL__OUTPUT__CONFIG_PATH=/path/to/guardrails_output.json
533
685
  # Messaging platforms (optional)
534
686
  export AK_SLACK__AGENT=my-agent
535
687
  export AK_WHATSAPP__AGENT=my-agent
536
688
  export AK_MESSENGER__AGENT=my-agent
537
689
  export AK_INSTAGRAM__AGENT=my-agent
538
690
  export AK_TELEGRAM__AGENT=my-agent
691
+ export AK_GMAIL__AGENT=my-agent
692
+ export AK_GMAIL__CLIENT_ID=your-google-client-id
693
+ export AK_GMAIL__CLIENT_SECRET=your-google-client-secret
539
694
  ```
540
695
 
541
696
  #### .env File
@@ -596,6 +751,17 @@ test:
596
751
  model: gpt-4o-mini
597
752
  provider: openai
598
753
  embedding_model: text-embedding-3-small
754
+ guardrail:
755
+ input:
756
+ enabled: false
757
+ type: openai
758
+ model: gpt-4o-mini
759
+ config_path: /path/to/guardrails_input.json
760
+ output:
761
+ enabled: false
762
+ type: openai
763
+ model: gpt-4o-mini
764
+ config_path: /path/to/guardrails_output.json
599
765
  slack:
600
766
  agent: my-agent
601
767
  agent_acknowledgement: "Processing your request..."
@@ -608,6 +774,10 @@ instagram:
608
774
  agent: my-agent
609
775
  telegram:
610
776
  agent: my-agent
777
+ gmail:
778
+ agent: my-agent
779
+ poll_interval: 30
780
+ label_filter: "INBOX"
611
781
  ```
612
782
 
613
783
  #### config.json
@@ -654,6 +824,20 @@ telegram:
654
824
  "embedding_model": "text-embedding-3-small"
655
825
  }
656
826
  },
827
+ "guardrail": {
828
+ "input": {
829
+ "enabled": false,
830
+ "type": "openai",
831
+ "model": "gpt-4o-mini",
832
+ "config_path": "/path/to/guardrails_input.json"
833
+ },
834
+ "output": {
835
+ "enabled": false,
836
+ "type": "openai",
837
+ "model": "gpt-4o-mini",
838
+ "config_path": "/path/to/guardrails_output.json"
839
+ }
840
+ },
657
841
  "slack": {
658
842
  "agent": "my-agent",
659
843
  "agent_acknowledgement": "Processing your request..."
@@ -670,6 +854,11 @@ telegram:
670
854
  },
671
855
  "telegram": {
672
856
  "agent": "my-agent"
857
+ },
858
+ "gmail": {
859
+ "agent": "my-agent",
860
+ "poll_interval": 30,
861
+ "label_filter": "INBOX"
673
862
  }
674
863
  }
675
864
  ```
@@ -4,10 +4,10 @@ build-backend = "uv_build"
4
4
 
5
5
  [project]
6
6
  name = "agentkernel"
7
- version = "0.2.9"
7
+ version = "0.2.11"
8
8
  description = "Agent Kernel - Unified AI Agents Runtime"
9
9
  readme = "README.md"
10
- requires-python = ">=3.12"
10
+ requires-python = ">=3.12,<3.14"
11
11
  license = { text = "MIT" }
12
12
  authors = [
13
13
  { name = "Yaala Labs", email = "agentkernel@yaalalabs.com" }
@@ -34,10 +34,10 @@ crewai = [
34
34
  "openinference-instrumentation-litellm>=0.1.28",
35
35
  ]
36
36
  langgraph = [
37
- "langgraph~=0.6.2",
38
- "langchain~=0.3.27",
39
- "langchain_community~=0.3.27",
40
- "litellm~=1.74.3"
37
+ "langgraph~=1.0.5",
38
+ "langchain~=1.2.3",
39
+ "langchain_community~=0.4.1",
40
+ "litellm~=1.74.9"
41
41
  ]
42
42
  cli = [
43
43
 
@@ -49,8 +49,9 @@ redis = [
49
49
  "redis>=7.1.0",
50
50
  ]
51
51
  openai = [
52
- "openai-agents>=0.6.3",
52
+ "openai-agents>=0.6.5",
53
53
  "openinference-instrumentation-openai-agents>=1.4.0",
54
+ "openai-guardrails>=0.2.1",
54
55
  ]
55
56
  adk = [
56
57
  "google-adk>=1.14.1",
@@ -63,7 +64,8 @@ api = [
63
64
  "gunicorn>=23.0.0"
64
65
  ]
65
66
  slack = [
66
- "slack-bolt==1.22.0"
67
+ "slack-bolt==1.22.0",
68
+ "httpx>=0.27.0"
67
69
  ]
68
70
  whatsapp = [
69
71
  "httpx>=0.27.0"
@@ -115,7 +117,7 @@ package = true
115
117
 
116
118
  [tool.isort]
117
119
  profile = "black"
118
- line_length = 120
120
+ line_length = 150
119
121
 
120
122
  [tool.mypy]
121
123
  python_version = "3.12"
@@ -125,7 +127,7 @@ disallow_untyped_defs = true
125
127
  disallow_incomplete_defs = true
126
128
 
127
129
  [tool.black]
128
- line-length = 120
130
+ line-length = 150
129
131
  target-version = ["py312"]
130
132
 
131
133
  [tool.pytest.ini_options]
@@ -9,8 +9,9 @@ from a2a.types import AgentCard, InternalError, UnsupportedOperationError
9
9
  from a2a.utils import new_agent_text_message
10
10
  from a2a.utils.errors import ServerError
11
11
 
12
- from ...core import Agent, AgentService, GlobalRuntime
12
+ from ...core import Agent, AgentService
13
13
  from ...core.config import AKConfig
14
+ from ...core.runtime import Runtime
14
15
 
15
16
 
16
17
  class A2A:
@@ -45,9 +46,7 @@ class A2A:
45
46
  raise ValueError("RequestContext must have a message")
46
47
  try:
47
48
  response = await self._execute_agent(context.context_id, context.get_user_input())
48
- await event_queue.enqueue_event(
49
- new_agent_text_message(str(response), context.context_id, context.task_id)
50
- )
49
+ await event_queue.enqueue_event(new_agent_text_message(str(response), context.context_id, context.task_id))
51
50
  except Exception as e:
52
51
  error = "Sorry, Agent Kernel encountered an error while processing your request"
53
52
  self.log.error(traceback.format_exc())
@@ -69,7 +68,7 @@ class A2A:
69
68
  return
70
69
  if not AKConfig.get().a2a.enabled:
71
70
  return
72
- agents: dict[str, Agent] = GlobalRuntime.instance().agents()
71
+ agents: dict[str, Agent] = Runtime.current().agents()
73
72
  for name, agent in agents.items():
74
73
  whitelisted = AKConfig.get().a2a.agents == ["*"] or name in AKConfig.get().a2a.agents
75
74
  if not whitelisted: