Keyboards send events to the computer. An event says “scan code nnn down” or “scan code nnn up”. At the other end of the chain, applications running in a terminal expect input in the form of a sequence of characters.
When you press A, the keyboard sends the information “scan code 38 down”. The console driver looks up its keymap and transforms this into “character a”.
When you press a key or key combination that doesn't result in a character, the information needs to be encoded in terms of characters. A few keys and key combinations have corresponding control characters, e.g. Ctrl+A sends the character ␁ (byte value 1), Return sends the character ␍ (Ctrl+M, byte value 13), etc.
Most function keys don't have a corresponding character and instead send a sequence of characters that starts with the ␛ (escape, byte value 27) character. For example, the key Up is translated into the escape sequence ␛[A (three characters: escape, open bracket, capital A).
It seems that the "gerrit gsql" prompt is kinda "dumb" and doesn't understand most escape sequences so it simply displays the escape sequence. There is no glyph for the ␛ character, so it's displayed as ^[. The ^ sign is traditionally used as a prefix for control characters, and escape is ^[ because of its byte value: it's the byte value of [, minus 64.