diff --git a/CHANGELOG.md b/CHANGELOG.md
index 4d662cf3..cb328f11 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -12,6 +12,7 @@
     * Setting the following pyscript variables:
         * `__name__`: __main__
         * `__file__`: script path (as typed, ~ will be expanded)
+    * Only tab complete after redirection tokens if redirection is allowed
 * Other
     * Removed undocumented `py run` command since it was replaced by `run_pyscript` a while ago
 
diff --git a/cmd2/cmd2.py b/cmd2/cmd2.py
index 3b1fbb6f..5a728e56 100644
--- a/cmd2/cmd2.py
+++ b/cmd2/cmd2.py
@@ -1050,8 +1050,8 @@ class Cmd(cmd.Cmd):
                         in_pipe = False
                         in_file_redir = True
 
-                # Not a redirection token
-                else:
+                # Only tab complete after redirection tokens if redirection is allowed
+                elif self.allow_redirection:
                     do_shell_completion = False
                     do_path_completion = False
 

diff --git a/tests/test_completion.py b/tests/test_completion.py
index f545c8f9..e13d87de 100755
--- a/tests/test_completion.py
+++ b/tests/test_completion.py
@@ -902,11 +902,6 @@ class RedirCompType(enum.Enum):
     DEFAULT = 3,
     NONE = 4
 
-    """   
-    fake > > 
-    fake | grep > file 
-    fake | grep > file > 
-    """
 
 @pytest.mark.parametrize('line, comp_type', [
     ('fake', RedirCompType.DEFAULT),
@@ -933,31 +928,40 @@ class RedirCompType(enum.Enum):
     ('fake > file >>', RedirCompType.NONE),
 ])
 def test_redirect_complete(cmd2_app, monkeypatch, line, comp_type):
-    shell_cmd_complete_mock = mock.MagicMock(name='shell_cmd_complete')
-    monkeypatch.setattr("cmd2.Cmd.shell_cmd_complete", shell_cmd_complete_mock)
-
-    path_complete_mock = mock.MagicMock(name='path_complete')
-    monkeypatch.setattr("cmd2.Cmd.path_complete", path_complete_mock)
-
-    default_complete_mock = mock.MagicMock(name='fake_completer')
-
-    text = ''
-    line = '{} {}'.format(line, text)
-    endidx = len(line)
-    begidx = endidx - len(text)
+    # Test both cases of allow_redirection
+    cmd2_app.allow_redirection = True
+    for count in range(2):
+        shell_cmd_complete_mock = mock.MagicMock(name='shell_cmd_complete')
+        monkeypatch.setattr("cmd2.Cmd.shell_cmd_complete", shell_cmd_complete_mock)
+
+        path_complete_mock = mock.MagicMock(name='path_complete')
+        monkeypatch.setattr("cmd2.Cmd.path_complete", path_complete_mock)
+
+        default_complete_mock = mock.MagicMock(name='fake_completer')
+
+        text = ''
+        line = '{} {}'.format(line, text)
+        endidx = len(line)
+        begidx = endidx - len(text)
+
+        cmd2_app._redirect_complete(text, line, begidx, endidx, default_complete_mock)
+
+        if comp_type == RedirCompType.SHELL_CMD:
+            shell_cmd_complete_mock.assert_called_once()
+        elif comp_type == RedirCompType.PATH:
+            path_complete_mock.assert_called_once()
+        elif comp_type == RedirCompType.DEFAULT:
+            default_complete_mock.assert_called_once()
+        else:
+            shell_cmd_complete_mock.assert_not_called()
+            path_complete_mock.assert_not_called()
+            default_complete_mock.assert_not_called()
 
-    cmd2_app._redirect_complete(text, line, begidx, endidx, default_complete_mock)
+        # Do the next test with allow_redirection as False
+        cmd2_app.allow_redirection = False
+        if comp_type != RedirCompType.DEFAULT:
+            comp_type = RedirCompType.NONE
 
-    if comp_type == RedirCompType.SHELL_CMD:
-        shell_cmd_complete_mock.assert_called_once()
-    elif comp_type == RedirCompType.PATH:
-        path_complete_mock.assert_called_once()
-    elif comp_type == RedirCompType.DEFAULT:
-        default_complete_mock.assert_called_once()
-    else:
-        shell_cmd_complete_mock.assert_not_called()
-        path_complete_mock.assert_not_called()
-        default_complete_mock.assert_not_called()
 
 def test_complete_set_value(cmd2_app):
     text = ''

Tab completions after pipe | is still active on disabled redirection
With
self.allow_redirection = False

I can list system commands using any_command | <TAB>

My goal is to lock user in CLI without any way to run system command or access system files and with that in mind default cmd2 is quite "open"
tests/test_completion.py::test_redirect_complete[fake
tests/test_completion.py::test_cmd2_command_completion_single tests/test_completion.py::test_complete_command_single tests/test_completion.py::test_complete_empty_arg tests/test_completion.py::test_complete_bogus_command tests/test_completion.py::test_complete_exception tests/test_completion.py::test_complete_macro tests/test_completion.py::test_default_sort_key tests/test_completion.py::test_cmd2_command_completion_multiple tests/test_completion.py::test_cmd2_command_completion_nomatch tests/test_completion.py::test_cmd2_help_completion_single tests/test_completion.py::test_cmd2_help_completion_multiple tests/test_completion.py::test_cmd2_help_completion_nomatch tests/test_completion.py::test_shell_command_completion_shortcut tests/test_completion.py::test_shell_command_completion_doesnt_match_wildcards tests/test_completion.py::test_shell_command_completion_multiple tests/test_completion.py::test_shell_command_completion_nomatch tests/test_completion.py::test_shell_command_completion_doesnt_complete_when_just_shell tests/test_completion.py::test_shell_command_completion_does_path_completion_when_after_command tests/test_completion.py::test_shell_commmand_complete_in_path tests/test_completion.py::test_path_completion_single_end tests/test_completion.py::test_path_completion_multiple tests/test_completion.py::test_path_completion_nomatch tests/test_completion.py::test_default_to_shell_completion tests/test_completion.py::test_path_completion_no_text tests/test_completion.py::test_path_completion_no_path tests/test_completion.py::test_path_completion_cwd_is_root_dir tests/test_completion.py::test_path_completion_doesnt_match_wildcards tests/test_completion.py::test_path_completion_complete_user tests/test_completion.py::test_path_completion_user_path_expansion tests/test_completion.py::test_path_completion_directories_only tests/test_completion.py::test_basic_completion_single tests/test_completion.py::test_basic_completion_multiple tests/test_completion.py::test_basic_completion_nomatch tests/test_completion.py::test_delimiter_completion tests/test_completion.py::test_flag_based_completion_single tests/test_completion.py::test_flag_based_completion_multiple tests/test_completion.py::test_flag_based_completion_nomatch tests/test_completion.py::test_flag_based_default_completer tests/test_completion.py::test_flag_based_callable_completer tests/test_completion.py::test_index_based_completion_single tests/test_completion.py::test_index_based_completion_multiple tests/test_completion.py::test_index_based_completion_nomatch tests/test_completion.py::test_index_based_default_completer tests/test_completion.py::test_index_based_callable_completer tests/test_completion.py::test_tokens_for_completion_quoted tests/test_completion.py::test_tokens_for_completion_unclosed_quote tests/test_completion.py::test_tokens_for_completion_punctuation tests/test_completion.py::test_tokens_for_completion_quoted_punctuation tests/test_completion.py::test_add_opening_quote_basic_no_text tests/test_completion.py::test_add_opening_quote_basic_nothing_added tests/test_completion.py::test_add_opening_quote_basic_quote_added tests/test_completion.py::test_add_opening_quote_basic_single_quote_added tests/test_completion.py::test_add_opening_quote_basic_text_is_common_prefix tests/test_completion.py::test_add_opening_quote_delimited_no_text tests/test_completion.py::test_add_opening_quote_delimited_nothing_added tests/test_completion.py::test_add_opening_quote_delimited_quote_added tests/test_completion.py::test_add_opening_quote_delimited_text_is_common_prefix tests/test_completion.py::test_add_opening_quote_delimited_space_in_prefix tests/test_completion.py::test_no_completer tests/test_completion.py::test_quote_as_command tests/test_completion.py::test_complete_multiline_on_single_line tests/test_completion.py::test_complete_multiline_on_multiple_lines tests/test_completion.py::test_redirect_complete[fake-RedirCompType.DEFAULT] tests/test_completion.py::test_complete_set_value tests/test_completion.py::test_complete_set_value_invalid_settable tests/test_completion.py::test_cmd2_subcommand_completion_single_end tests/test_completion.py::test_cmd2_subcommand_completion_multiple tests/test_completion.py::test_cmd2_subcommand_completion_nomatch tests/test_completion.py::test_help_subcommand_completion_single tests/test_completion.py::test_help_subcommand_completion_multiple tests/test_completion.py::test_help_subcommand_completion_nomatch tests/test_completion.py::test_subcommand_tab_completion tests/test_completion.py::test_subcommand_tab_completion_with_no_completer tests/test_completion.py::test_subcommand_tab_completion_space_in_text tests/test_completion.py::test_subcmd_with_unknown_completion_single_end tests/test_completion.py::test_subcmd_with_unknown_completion_multiple tests/test_completion.py::test_subcmd_with_unknown_completion_nomatch tests/test_completion.py::test_help_subcommand_completion_single_scu tests/test_completion.py::test_help_subcommand_completion_multiple_scu tests/test_completion.py::test_help_subcommand_completion_with_flags_before_command tests/test_completion.py::test_complete_help_subcommands_with_blank_command tests/test_completion.py::test_help_subcommand_completion_nomatch_scu tests/test_completion.py::test_subcommand_tab_completion_scu tests/test_completion.py::test_subcommand_tab_completion_with_no_completer_scu tests/test_completion.py::test_subcommand_tab_completion_space_in_text_scu